public void DeleteElement(GraphicElement el)
 {
     el.DetachAll();
     EraseTopToBottom(elements);
     elements.Remove(el);
     el.Dispose();
     DrawBottomToTop(elements);
 }
Exemple #2
0
        protected virtual void RemoveElement(GraphicElement el, bool dispose)
        {
            elements.Remove(el);
            el.Removed(dispose);

            if (dispose)
            {
                el.Dispose();
            }
        }
Exemple #3
0
 public void DeleteElement(GraphicElement el)
 {
     // TODO: don't redraw all the elements, only erase the current element and update the screen!
     // See how this is done with Ungroup.
     el.DetachAll();
     EraseTopToBottom(elements);
     elements.Remove(el);
     el.Dispose();
     DrawBottomToTop(elements);
 }
Exemple #4
0
 public void DeleteElement()
 {
     if (selectedElement != null)
     {
         selectedElement.DetachAll();
         EraseTopToBottom(elements);
         elements.Remove(selectedElement);
         selectedElement.Dispose();
         selectedElement       = null;
         selectedAnchor        = null;
         showingAnchorsElement = null;
         dragging = false;
         DrawBottomToTop(elements);
         ElementSelected.Fire(this, new ElementEventArgs());
         // Need to refresh the entire screen to remove the element from the screen itself.
         canvas.Invalidate();
     }
 }
        // Used by secondary operations, particularly undo events, where we delete things we've pasted or dropped onto the canvas.
        public void DeleteElement(GraphicElement el, bool dispose = true)
        {
            // TODO: don't redraw all the elements, only erase the current element and update the screen!
            // See how this is done with Ungroup.
            el.DetachAll();
            var els = EraseIntersectionsTopToBottom(el);

            elements.Remove(el);
            List <GraphicElement> elsToRedraw = els.ToList();

            elsToRedraw.Remove(el);
            el.Connections.ForEach(c => c.ToElement.RemoveConnection(c.ToConnectionPoint.Type));
            el.Connections.Clear();
            DrawBottomToTop(elsToRedraw);
            UpdateScreen(els);

            if (dispose)
            {
                el.Dispose();
            }

            selectedElements.Remove(el);
        }