Пример #1
0
 private void Diagram_CommandExecuted(object sender, CommandRoutedEventArgs e)
 {
     if (e.Command.Name == "Add Connection")
     {
         this.Diagram.Undo();
     }
     else if ((e.Command.Name == "Change Target" || e.Command.Name == "Change Source"))
     {
         if ((this.oldVertex == null || this.newVertex == null))
         {
             this.Diagram.Undo();
         }
         else if (this.oldVertex.Key != this.newVertex.Key)
         {
             this.Diagram.Undo();
         }
     }
 }
Пример #2
0
        private void diagram_CommandExecuted_1(object sender, CommandRoutedEventArgs e)
        {
            var comm = e.Command.Name;

            if (comm == "Delete Items" || comm == "Cut Items")
            {
                if (this.diagram.SelectedItem is RadDiagramContainerShape)
                {
                    var cont = (RadDiagramContainerShape)this.diagram.SelectedItem;
                    foreach (var item in cont.Items)
                    {
                        cont.Items.Remove(item);
                    }
                }
                else
                {
                    var cont = (RadDiagramShape)this.diagram.SelectedItem;
                    e.Handled = true;
                    this.diagram.Items.Remove(cont);
                }
            }
        }
Пример #3
0
        private void diagram_CommandExecuted_1(object sender, CommandRoutedEventArgs e)
        {
            var comm = e.Command.Name;
            if (comm == "Delete Items" || comm == "Cut Items")
            {
                if (this.diagram.SelectedItem is RadDiagramContainerShape)
                {
                    var cont = (RadDiagramContainerShape)this.diagram.SelectedItem;
                    foreach(var item in cont.Items)
                    {
                        cont.Items.Remove(item);
                    }
                }
                else
                {
                    var cont = (RadDiagramShape)this.diagram.SelectedItem;
                    e.Handled = true;
                    this.diagram.Items.Remove(cont);

                }
            }
        }