/// <summary> /// Establish connection to target VSTS team project /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnTarget_Click(object sender, RoutedEventArgs e) { // Establish connection to target system. TeamProjectPicker projectPicker = new TeamProjectPicker(); projectPicker.ShowDialog(); if (projectPicker.SelectedTeamProjectCollection != null) { tpTargetCollection = projectPicker.SelectedTeamProjectCollection; txtTargetProject.Text = String.Format(@"{0}{1}{2}", tpTargetCollection.ToString(), Environment.NewLine, projectPicker.SelectedProjects[0].ToString()); tmTargetService = tpTargetCollection.GetService <ITestManagementService>(); targetProjectName = projectPicker.SelectedProjects[0].Name; tmTargetProject = tmTargetService.GetTeamProject(targetProjectName); wisTargetProject = new WorkItemStore(tpTargetCollection, WorkItemStoreFlags.BypassRules); } }
public MainForm(TfsTeamProjectCollection pc, Workspace ws) { InitializeComponent(); m_projectCollection = pc; m_workspace = ws; m_vcServer = m_projectCollection.GetService <VersionControlServer>(); Text = "TFV - " + m_projectCollection.ToString(); stvServerTreeView.SourceControl = m_vcServer; stvServerTreeView.Workspace = m_workspace; ltvLocalTreeView.SourceControl = m_vcServer; ltvLocalTreeView.Workspace = m_workspace; UpdateLimitViewToWorkspace(); UpdateShowDeleted(); stvServerTreeView.LastSelectedServerItemChanged += stvServerTreeView_CurrentServerItemChanged; stvServerTreeView.BackgroundWorkStarted += delegate(object o, EventArgs e) { StartWaiting(); }; stvServerTreeView.BackgroundWorkEnded += delegate(object o, EventArgs e) { StopWaiting(); }; ltvLocalTreeView.LastSelectedServerItemChanged += stvServerTreeView_CurrentServerItemChanged; ltvLocalTreeView.BackgroundWorkStarted += delegate(object o, EventArgs e) { StartWaiting(); }; ltvLocalTreeView.BackgroundWorkEnded += delegate(object o, EventArgs e) { StopWaiting(); }; cbAddress.Text = stvServerTreeView.LastSelectedServerItem; m_vcServer.UpdatedWorkspace += m_vcServer_UpdatedWorkspace; m_vcServer.FolderContentChanged += m_vcServer_FolderContentChanged; m_vcServer.CommitCheckin += m_vcServer_CommitCheckin; s_instanceCount++; }