Пример #1
0
        protected override void OnMouseUp(MouseEventArgs e)
        {
            base.OnMouseUp(e);
            foreach (var paintObject in EndPaintObjects.Union(BeginPaintObjects))
            {
                if (paintObject.TitleBar.Contains(e.Location))
                {
                    if (ObjectTitleClicked != null)
                    {
                        ObjectTitleClicked(this, new ItemClickedEventArgs(new ChildPosition
                        {
                            Parent = paintObject.Parent
                        }));
                    }
                }
            }

            if (BeginPoint != null && EndPoint != null && BeginPoint.Child != EndPoint.Child)
            {
                if (ConnectChange != null && BeginPoint != EndPoint)
                {
                    ConnectChange(this, new UpdateConnectEventArgs(EndPoint, BeginPoint));
                }
                BeginPoint = null;
                Refresh();
            }
            else
            {
                ChildPosition beginPoint = null;

                foreach (var point in BeginPoints.Union(EndPoints))
                {
                    if (point.IsNearPoint(e.X, e.Y))
                    {
                        if (ItemClicked != null)
                        {
                            beginPoint = point;
                        }
                    }
                }

                if (beginPoint != null)
                {
                    ItemClicked(this, new ItemClickedEventArgs(beginPoint));
                }
            }
        }
Пример #2
0
 public UpdateConnectEventArgs(ChildPosition endPoint, ChildPosition beginPoint)
 {
     EndPoint   = beginPoint;
     BeginPoint = endPoint;
     IsConnect  = false;
 }
Пример #3
0
 public ItemClickedEventArgs(ChildPosition position)
 {
     Position = position;
 }