public void AddChild(DrawComponent drawComponent)
        {
            drawComponent.ParentContainer = this;

            drawComponent.Offset = new Point(drawComponent.Offset.X, _heightOfAllChildren);
            drawComponent.Size = new Size(Size.Width, drawComponent.Size.Height);

            _drawComponents.Add(drawComponent);
            _heightOfAllChildren += drawComponent.Size.Height;

            _drawComponents.Sort((dc1, dc2) => dc1.ZOrder.CompareTo(dc2.ZOrder));
        }
 public void ClearChildren(DrawComponent drawComponent)
 {
     _drawComponents.Clear();
 }
Exemplo n.º 3
0
 public static bool IsInputStartInBounds(DrawComponent drawComponent, MouseEventArgs mouseEventArgs)
 {
     return ((mouseEventArgs.X >= drawComponent.Offset.X && mouseEventArgs.X <= drawComponent.Offset.X + drawComponent.Size.Width)
         && (mouseEventArgs.Y >= drawComponent.Offset.Y && mouseEventArgs.Y <= drawComponent.Offset.Y + drawComponent.Size.Height));
 }
 public void AddChild(DrawComponent drawComponent)
 {
     _drawComponents.Add(drawComponent);
 }