Beispiel #1
0
 public void RemoveElement(EditorElementBase element)
 {
     foreach (var c in connections.Where(con => con.Element1 == element || con.Element2 == element).ToArray())
     {
         RemoveConnectionPressed?.Invoke(c);
     }
     Controls.Remove(element);
     element.Dispose();
     Element_Selected(null);
 }
Beispiel #2
0
 private void Element_Delete()
 {
     foreach (var element in Controls.OfType <EditorElementBase>())
     {
         if (element.IsSelected)
         {
             if (element is ConnectionControl)
             {
                 RemoveConnectionPressed?.Invoke(connections.First(c => c.Name == element.Name));
             }
             else
             {
                 RemoveElementPressed?.Invoke(element);
             }
         }
     }
 }