private void Runner() { while (true) { try { if (BranchesToProcess == null) { BranchesToProcess = DbSession.Branches.ToList(); } if (CurrentConfig == null) { CurrentConfig = DbSession.SystemConfiguration.FirstOrDefault(); if (CurrentConfig == null) { return; } } var results = new Dictionary <BranchStore, List <MergeCandidate> >(); foreach (var branch in BranchesToProcess) { var tpc = CurrentConfig.GenerateTfsConnection(); var vcs = (VersionControlServer)tpc.GetService(typeof(VersionControlServer)); var mergeCandidates = vcs.GetMergeCandidates(branch.Value, branch.MergeTo, RecursionType.Full).ToList(); mergeCandidates = FilterMerges(mergeCandidates); if (mergeCandidates.Count > 0) { results.Add(branch, mergeCandidates); } } if (results.Count > 0) { MergesFound(results); } } catch { } Thread.Sleep(SleepSpan); } }
private void uxTest_Click(object sender, EventArgs e) { var testSystemConfig = new SystemConfiguration { TfsServer = uxTfsServer.Text, TfsUsername = uxUsername.Text, TfsUsernameDomain = uxDomain.Text, TfsPassword = uxPassword.Text }; PopulateTree(testSystemConfig); }
public void ResetBranches() { BranchesToProcess = null; CurrentConfig = null; }
private void PopulateTree(SystemConfiguration systemConfig) { uxLoginPane.Enabled = false; try { uxBranchesTree.CheckBoxes = true; var toCheck = DbSession.Branches.ToList(); var branches = systemConfig.ListTfsBranches(); ProcessBranchesState(branches, toCheck); uxBranchesTree.Bind(branches); foreach (var configuration in DbSession.SystemConfiguration) DbSession.SystemConfiguration.Remove(configuration); DbSession.SaveChanges(); DbSession.SystemConfiguration.Add(systemConfig); DbSession.SaveChanges(); CurrentConfig = systemConfig; uxBranchesPanel.Enabled = true; StartMergeMonitor(); } catch (Exception ex) { MessageBox.Show(Resources.ErrorWhileListingBranches + ex.Message); uxLoginPane.Enabled = true; } }