public void Insert(int i, IGraphicElement element) { _elements.Insert(i, element); if (SelectionChanged != null) { SelectionChanged(this, new EventArgs()); } }
public void Remove(IGraphicElement element) { _elements.Remove(element); if (SelectionChanged != null) { SelectionChanged(this, new EventArgs()); } }
public void AddElement(uint layer, IGraphicElement element) { if (layers.ContainsKey(layer)) { layers[layer].Add(element); } else { layers.Add(layer, new List <IGraphicElement>() { element }); } }
void AddGraphicElement(IGraphicElement _element) { this.graphicsGroup.GraphicElementList.Add(_element); }
public bool Contains(IGraphicElement element) { return(_elements.Contains(element)); }
public void Remove(IGraphicElement element) { // might be too strict implementation throw new NotSupportedException($"A {GetType().Name} does not have children to remove from"); }
public void Add(IGraphicElement childElement) { // might be too strict implementation throw new NotSupportedException($"You cannot add a child element to a {GetType().Name}"); }
public void Remove(IGraphicElement element) { // this is a good compromise. Tolerant to errors in release, but strict in debug. Debug.Fail("A Line does not have children to remove from"); }
public void Add(IGraphicElement childElement) { // this is a good compromise. Tolerant to errors in release, but strict in debug. Debug.Fail("You cannot add a child element to a Line"); }
private static void AddElementWhenNameContains(string content, GraphicText text, IGraphicElement parent) { IGraphicElementContainer container = parent as IGraphicElementContainer; if (container != null) { if (container.Name.Contains(content)) { container.Add(text); } foreach (var child in container.GetChildElements()) { AddElementWhenNameContains(content, text, child); } } }
public static void Draw(this IGraphicElement graphic) { graphic.Draw(0); }
public LayoutElement(IGraphicElement presentation) { Presentation = presentation; Children = new LinkedList <LayoutElement>(); }