Show the locks on streams listed in Locks.exe.config
.
- See also
- AcLocks constructor, LockStreams.cs, PromoRights.cs
- Locks.exe.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="Streams" type="AcUtils.StreamsSection, AcUtils, Version=1.6.4.0, Culture=neutral, PublicKeyToken=26470c2daf5c2e2f, processorArchitecture=MSIL" />
</configSections>
<Streams>
<streams>
</streams>
</Streams>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
</configuration>
namespace Locks
{
class Program
{
private static StreamsCollection _selStreams;
static int Main()
{
bool ret = false;
StreamsSection streamsConfigSection = ConfigurationManager.GetSection("Streams") as StreamsSection;
if (streamsConfigSection == null)
Console.WriteLine("Error creating StreamsSection");
else
{
_selStreams = streamsConfigSection.Streams;
Task<bool> pini = promoRightsAsync();
ret = pini.Result;
}
return (ret) ? 0 : 1;
}
public static async Task<bool> promoRightsAsync()
{
AcLocks locks = new AcLocks();
if (!(await locks.initAsync(_selStreams))) return false;
foreach (AcLock lk in locks.OrderBy(n => n.Name).ThenByDescending(n => n.Kind))
Console.WriteLine(lk);
return true;
}
}
}