public static string GetRepoPreferredSolution(RepoModel repoModel) { var iniFile = new IniFile(FormMain.RepoPropertiesIni); var fileName = iniFile.ReadString(repoModel.Name, "PreferredSolution", ""); if (!string.IsNullOrEmpty(fileName)) { return(!File.Exists(fileName) ? string.Empty : fileName); } var slnList = repoModel.GetSolutionList(); return(slnList.Count == 1 ? slnList.First() : string.Empty); }
private void RepoPropertiesForm_Load(object sender, EventArgs e) { //Remove tabControl1.TabPages.Remove(tabPageChangeTrends); Cursor.Current = Cursors.WaitCursor; var slnList = repoModel.GetSolutionList(); slnList.ForEach(x => comboBoxPreferredSolution.Items.Add(x)); iniFile = new IniFile(FormMain.RepoPropertiesIni); comboBoxPreferredSolution.Text = iniFile.ReadString(repoModel.Name, "PreferredSolution", ""); checkBoxOpenAsAdmin.Checked = iniFile.ReadBool(repoModel.Name, "OpenPreferredSolutionAsAdmin", false); gridControl1.Enabled = false; gridControl2.Enabled = false; timer1.Start(); if (string.IsNullOrEmpty(comboBoxPreferredSolution.Text) && slnList.Count == 1) { comboBoxPreferredSolution.SelectedIndex = 0; } checkBoxEnableSmartGit.Checked = iniFile.ReadBool(repoModel.Name, "EnableSmartGit", false); panelSmartGitRepo.Enabled = checkBoxEnableSmartGit.Checked; var linkedReposString = iniFile.ReadString(repoModel.Name, "SmartGitLinkedRepos", ""); if (string.IsNullOrEmpty(linkedReposString)) { listBoxSmartGitLinkedRepos.Items.Add("(Auto Detect)"); } else { linkedReposString.Split('|').ToList().ForEach(x => listBoxSmartGitLinkedRepos.Items.Add(x)); } tabControl1.SelectedIndex = iniFile.ReadInteger(repoModel.Name, "LastTabIndex", 0); labelLinkedReposCount.Text = $"{repoModel.GetDependentRepoNamesList().Count} linked repo(s)"; }