public void ReloadModules(string valueToSelect = null) { if (String.IsNullOrEmpty(valueToSelect)) { valueToSelect = Module; } List <string> modules; RepoScanner.ScanModules(dBase.svnClient, dBase.GetReleaseRootUrl(), out modules); Modules.Clear(); foreach (var i in modules) { Modules.Add(i); } // if current module still exists, pick it if (!String.IsNullOrEmpty(valueToSelect) && Modules.Contains(valueToSelect)) { ModuleIndex = Modules.IndexOf(valueToSelect); } else if (Modules.Count > 0) { ModuleIndex = 0; } else { ModuleIndex = -1; } }