public void RemoveElement(Element element) { Elements.SetModifiable(true); Elements.Remove(element); element.SetGroup(null); Elements.SetModifiable(false); }
private void RemoveLayerElements(bool shapes, bool lines) { ArrayList keys = new ArrayList(); //Determine the keys to be removed //Must use the dictionery entry object to retrieve the key foreach (DictionaryEntry de in Elements) { Element element = (Element)de.Value; if (shapes && element is Shape) { keys.Add(de.Key); } if (lines && element is Line) { keys.Add(de.Key); } } //Remove keys from collection Elements.SetModifiable(true); foreach (string key in keys) { Elements.Remove(key); } Elements.SetModifiable(false); }
public void RemoveElements(ElementList elements) { Elements.SetModifiable(true); foreach (Element element in elements) { Elements.Remove(element); element.SetGroup(null); } Elements.SetModifiable(false); }
//Occurs when an element is removed from the elements collection private void Element_Remove(object sender, ElementsEventArgs e) { if (e.Value is Shape) { ResetLines((Shape)e.Value); } //Remove from the renderlist Elements.Remove(e.Value); //Raise the ElementRemovedEvent OnElementRemoved(e.Value); OnModelInvalid(); }