Remove() 개인적인 메소드

private Remove ( BaseElement element ) : void
element BaseElement
리턴 void
예제 #1
0
        public void DeleteElement(BaseElement el)
        {
            if ((el != null) && !(el is ConnectorElement))
            {
                //Delete link
                if (el is BaseLinkElement)
                {
                    BaseLinkElement lnk = (BaseLinkElement)el;
                    DeleteLink(lnk);
                    return;
                }

                //Delete node
                if (el is NodeElement)
                {
                    NodeElement conn = ((NodeElement)el);
                    foreach (ConnectorElement elconn in conn.Connectors)
                    {
                        BaseLinkElement lnk;
                        for (int i = elconn.Links.Count - 1; i >= 0; i--)
                        {
                            lnk = (BaseLinkElement)elconn.Links[i];
                            DeleteLink(lnk);
                        }
                    }

                    if (selectedNodes.Contains(el))
                    {
                        selectedNodes.Remove(el);
                    }
                }

                if (SelectedElements.Contains(el))
                {
                    selectedElements.Remove(el);
                }

                elements.Remove(el);

                OnAppearancePropertyChanged(new EventArgs());
            }
            el = null;
        }
예제 #2
0
 internal void RemoveLink(BaseLinkElement lnk)
 {
     links.Remove(lnk);
 }