/// <summary>Scans the directory.</summary> /// <returns> /// Return true if at least two bots are active. /// </returns> private bool ScanDirectory() { int active = 0; BotLocations.Clear(); // Disable all. foreach (var bot in Bots) { bot.Info = bot.Info.SetIsActive(true); } foreach (var dir in RootDirectory.GetDirectories().Where(d => d.Name != "bin" && d.Name != "zips")) { BotInfo info; if (BotInfo.TryCreate(dir, out info)) { var bot = Bots.GetOrCreate(info); if (!info.Inactive) { BotLocations[bot.Info] = dir; active++; } } } return(active > 1); }