Example #1
0
 public void DeleteGesture(Gesture g)
 {
     if (MessageBox.Show(string.Format(GlblRes.DeleteGestureFromCollectionConfirmation, g.Name),
                         GlblRes.DeleteGestureFromCollection, MessageBoxButton.YesNo)
         == MessageBoxResult.Yes)
     {
         GestureCollection.Remove(g);
     }
 }
Example #2
0
        public void DeleteGestureButton_Click(object sender, RoutedEventArgs e)
        {
            Button  b = (Button)sender;
            Gesture g = (Gesture)b.DataContext;

            if (MessageBox.Show("Do you really want to delete the gesture \"" + g.Name + "\" from the collection?",
                                "Delete Gesture from Collection",
                                MessageBoxButton.YesNo) == MessageBoxResult.Yes)
            {
                GestureCollection.Remove(g);
            }
        }
Example #3
0
        /// <summary>
        /// Undo changes done to gesture (or if it was a new one discard it)
        /// </summary>
        public void DiscardGesture()
        {
            Gesture g = (Gesture)TheWorkspace.DataContext;

            if (ExGesture == null)                                           // If the gesture is a new gesture...
            {
                GestureCollection.Remove(g);                                 //...remove it from the Gesture Collection
            }
            else                                                             // else if the gesture is an existing gesture being edited...
            {
                GestureCollection[GestureCollection.IndexOf(g)] = ExGesture; //...restore it to its initial state
            }
            CloseEditor();
        }
Example #4
0
        public void DiscardGesture(object parameter)
        {
            Gesture g = (Gesture)TheWorkspace.DataContext;

            // If the gesture is a new gesture, remove that m**********r from the Gesture Collection
            if (ExGesture == null)
            {
                GestureCollection.Remove(g);
            }
            // If the gesture is an existing gesture being edited, restore the m**********r to its initial state
            else
            {
                GestureCollection[GestureCollection.IndexOf(g)] = ExGesture;
            }
            // Go go go
            KillEditor();
        }