Exemplo n.º 1
0
        /// <summary>
        /// opens the shelve dialog and calls the shelve method based on the dialog results
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void shelve_Click(object sender, RoutedEventArgs e)
        {
            string message = "";
            foreach (changeItem item in shelveCollection)
            {
                message += item.fileName + "\n";
            }
            message += ".";

            // pass the shelve window the collection of pending changes so they can select what to shelve
            shelvewindow = new ShelveWindow(changesCollection, activeWorkspace);
            shelvewindow.ShowDialog();
            if (shelvewindow.DialogResult.HasValue && shelvewindow.DialogResult.Value)
            {
                shelveCollection = shelvewindow.shelveCollection;
                // error checking is done in the shelvewindow
                Shelve();
            }
            else
            {
                // user pushed cancel
            }
        }
        private void shelve_Click(object sender, RoutedEventArgs e)
        {
            //List<PendingChange> myChanges = new List<PendingChange>();
            //PendingChange[] pendingChanges = activeWorkspace.GetPendingChanges();
            // im going to read up about shelving.. the shelve function needs a shelvset, pendingchanges[], comment
            // it seems to pretty much the same and i think i get the idea but i want to ready up on it some before i write this

            // any code after show dialog will not execute until the dialog has been closed, we can still you the things that belong
            // to that window
            //shelvewindow.shelvesetName.Text
            string message = "";
            foreach (changeItem item in shelveCollection)
            {
                message += item.fileName + "\n";
            }
            message += ".";
            // DEBUG
            // MessageBox.Show(message);
            // TODO the shelvewindow cant bind to this shelveCollection because i dont have the binding path correct. shelvewindow is
            // in a different class so i need to map it to myControl class and then it should work
            shelvewindow = new ShelveWindow(changesCollection);
            shelvewindow.ShowDialog();
            if (shelvewindow.DialogResult.HasValue && shelvewindow.DialogResult.Value)
            {
                // Debug
                MessageBox.Show("User clicked OK");
                shelveCollection = shelvewindow.shelveCollection;
                Shelve();
            }
            else
                // Debug
                MessageBox.Show("User clicked Cancel");
        }