For depots show workspaces that have a default group and "DEV3" in their name.
- ActiveWSpaces.exe.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="Depots" type="AcUtils.DepotsSection, AcUtils, Version=1.6.4.0, Culture=neutral, PublicKeyToken=26470c2daf5c2e2f, processorArchitecture=MSIL" />
</configSections>
<Depots>
<depots>
</depots>
</Depots>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
</configuration>
using System.Collections.Generic;
namespace ActiveWSpaces
{
class Program
{
private static DepotsCollection _selDepots;
static int Main()
{
bool ret = false;
DepotsSection depotsConfigSection = ConfigurationManager.GetSection("Depots") as DepotsSection;
if (depotsConfigSection == null)
Console.WriteLine("Error creating DepotsSection");
else
{
_selDepots = depotsConfigSection.Depots;
Task<bool> wini = showActiveWSpacesAsync();
ret = wini.Result;
}
return (ret) ? 0 : 1;
}
public static async Task<bool> showActiveWSpacesAsync()
{
AcDepots depots = new AcDepots();
if (!(await depots.initAsync(_selDepots))) return false;
var filter =
from s in depots.SelectMany(d => d.Streams)
where s.Name.Contains("DEV3") && s.HasDefaultGroup &&
select s;
foreach (AcStream s in filter.OrderBy(n => n.Depot).ThenBy(n => n))
Console.WriteLine(s.ToString("lv"));
return true;
}
}
}