Пример #1
0
 public void Insert(int i, IGraphicElement element)
 {
     _elements.Insert(i, element);
     if (SelectionChanged != null)
     {
         SelectionChanged(this, new EventArgs());
     }
 }
Пример #2
0
 public void Remove(IGraphicElement element)
 {
     _elements.Remove(element);
     if (SelectionChanged != null)
     {
         SelectionChanged(this, new EventArgs());
     }
 }
Пример #3
0
 public void AddElement(uint layer, IGraphicElement element)
 {
     if (layers.ContainsKey(layer))
     {
         layers[layer].Add(element);
     }
     else
     {
         layers.Add(layer, new List <IGraphicElement>()
         {
             element
         });
     }
 }
Пример #4
0
 void AddGraphicElement(IGraphicElement _element)
 {
     this.graphicsGroup.GraphicElementList.Add(_element);
 }
Пример #5
0
 public bool Contains(IGraphicElement element)
 {
     return(_elements.Contains(element));
 }
Пример #6
0
 public void Remove(IGraphicElement element)
 {
     // might be too strict implementation
     throw new NotSupportedException($"A {GetType().Name} does not have children to remove from");
 }
Пример #7
0
 public void Add(IGraphicElement childElement)
 {
     // might be too strict implementation
     throw new NotSupportedException($"You cannot add a child element to a {GetType().Name}");
 }
Пример #8
0
 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");
 }
Пример #9
0
 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");
 }
Пример #10
0
        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);
                }
            }
        }
Пример #11
0
 public static void Draw(this IGraphicElement graphic)
 {
     graphic.Draw(0);
 }
Пример #12
0
 public LayoutElement(IGraphicElement presentation)
 {
     Presentation = presentation;
     Children     = new LinkedList <LayoutElement>();
 }