// TODO // find out how pending changes list asks for the password to connect to TFS... if we do not have that for our window it will // break because we try to access something we do not have access to yet... public MyControl() { InitializeComponent(); this.DataContext = this; // something about this makes me nervous mc = this; shelvewindow = new ShelveWindow(); unshelvewindow = new UnshelveWindow(); }
public MyControl() { InitializeComponent(); this.DataContext = this; mc = this; shelvewindow = new ShelveWindow(); unshelvewindow = new UnshelveWindow(); }
/// <summary> /// opens the unshelve dialog and calls the unshelve method based on the dialog results /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void unshelve_Click(object sender, RoutedEventArgs e) { // this is to clear the collection each time you re-open the unshelve window. shelveSetCollection.Clear(); listOfShelveSets.Clear(); // passes all the shelvesets in all the workspaces foreach (Workspace workspace in allWorkSpaces) { Shelveset[] shelveSets = workspace.VersionControlServer.QueryShelvesets(null, null); foreach (Shelveset set in shelveSets) { if (!listOfShelveSets.Contains(set.Name)) { listOfShelveSets.Add(set.Name); shelveSetCollection.Add(set); } } } unshelvewindow = new UnshelveWindow(shelveSetCollection, activeWorkspace); unshelvewindow.ShowDialog(); if (unshelvewindow.DialogResult.HasValue && unshelvewindow.DialogResult.Value) { Unshelve(); } else { //user clicked cancel } }
private void unshelve_Click(object sender, RoutedEventArgs e) { // TODO // rather than just passing the shelvesets for the current workspace. we need to pass a bigger object // in order to query all shelvesets in all workspaces. // this is to clear the collection each time you re-open the unshelve window. shelveSetCollection.Clear(); foreach (Workspace workspace in allWorkSpaces) { Shelveset[] shelveSets = workspace.VersionControlServer.QueryShelvesets(null, null); foreach (Shelveset set in shelveSets) { shelveSetCollection.Add(set); } } unshelvewindow = new UnshelveWindow(shelveSetCollection, activeWorkspace); unshelvewindow.ShowDialog(); if (unshelvewindow.DialogResult.HasValue && unshelvewindow.DialogResult.Value) { // Debug MessageBox.Show("User clicked OK"); Unshelve(); } else // Debug MessageBox.Show("User clicked Cancel"); }