void BoxComponentMoved(BaseBoxComponent obj)
 {
     foreach (BaseComponent drawableCmp in model.Items)
     {
         drawableCmp.Accept(new BoxMoveVisitor(obj, true));
     }
 }        
 public override void OnParentMoved(BaseBoxComponent box, bool recompute)
 {
     if (this.ConnectionStart == box && this.ConnectionEnd == box)
     {
         this.ControlPoint1.Add(box.EdgePoints[this.ConnectionStartPointIndex].CloneAndSubtract(this.StartPoint));
         this.ControlPoint2.Add(box.EdgePoints[this.ConnectionStartPointIndex].CloneAndSubtract(this.StartPoint));
     }
     base.OnParentMoved(box, recompute);
 }
 public virtual void OnParentMoved(BaseBoxComponent box, bool recompute)
 {
     if (this.ConnectionStart == box)
     {
         this.StartPoint.X = box.EdgePoints[this.ConnectionStartPointIndex].X;
         this.StartPoint.Y = box.EdgePoints[this.ConnectionStartPointIndex].Y;
         this.ParentMoving = !recompute;
         this.RecomputePoints();
     }
     if (this.ConnectionEnd == box)
     {
         this.EndPoint.X   = box.EdgePoints[this.ConnectionEndPointIndex].X;
         this.EndPoint.Y   = box.EdgePoints[this.ConnectionEndPointIndex].Y;
         this.ParentMoving = !recompute;
         this.RecomputePoints();
     }
 }
 public virtual void OnParentMoved(BaseBoxComponent box, bool recompute)
 {
     if (this.ConnectionStart == box)
     {
         this.StartPoint.X = box.EdgePoints[this.ConnectionStartPointIndex].X;
         this.StartPoint.Y = box.EdgePoints[this.ConnectionStartPointIndex].Y;
         this.ParentMoving = !recompute;
         this.RecomputePoints();
     }
     if (this.ConnectionEnd == box)
     {
         this.EndPoint.X = box.EdgePoints[this.ConnectionEndPointIndex].X;
         this.EndPoint.Y = box.EdgePoints[this.ConnectionEndPointIndex].Y;
         this.ParentMoving = !recompute;
         this.RecomputePoints();
     }
 }
 void LinePointMoved(BaseBoxComponent cmp)
 {   
     foreach (FlowChartPoint edgePoint in cmp.EdgePoints)
     {
         float d = GraphicsUtil.Distance(edgePoint, linePoint);
         cmp.IsSelected = (d < cmp.View.ViewFactory.EdgeBoxWidth * 5);
         if (d < cmp.View.ViewFactory.EdgeBoxWidth * 2)
         {                    
             linePoint.X = edgePoint.X;
             linePoint.Y = edgePoint.Y;
             if (lineCmp.StartPoint == linePoint)
             {
                 lineCmp.ConnectionStart = cmp;
                 lineCmp.ConnectionStartPointIndex = cmp.EdgePoints.IndexOf(edgePoint);
             }
             else if (lineCmp.EndPoint == linePoint)
             {
                 lineCmp.ConnectionEnd = cmp;
                 lineCmp.ConnectionEndPointIndex = cmp.EdgePoints.IndexOf(edgePoint);
             }
             return;
         }
     }            
 }
 public void VisitComponent(BaseBoxComponent cmp)
 {
     cmp.BoxComponentMoving += new Action<BaseBoxComponent>(BoxComponentMoving);
     cmp.BoxComponentMoved += new Action<BaseBoxComponent>(BoxComponentMoved);            
 }
 public override void OnParentMoved(BaseBoxComponent box, bool recompute)
 {
     if (this.ConnectionStart == box && this.ConnectionEnd == box)
     {
         this.ControlPoint1.Add(box.EdgePoints[this.ConnectionStartPointIndex].CloneAndSubtract(this.StartPoint));
         this.ControlPoint2.Add(box.EdgePoints[this.ConnectionStartPointIndex].CloneAndSubtract(this.StartPoint));
     }
     base.OnParentMoved(box, recompute);
 }        
 public BoxMoveVisitor(BaseBoxComponent box, bool recompute)
 {
     this.box = box;
     this.recompute = recompute;
 }