public void Commit(ConnectorDocking movePointDocking, ConnectorDocking otherPointDocking, Point newMovePointPosition, Point newOtherPointPosition, double newDistance)
 {
     if (_moveType == Types.MoveType.MoveStartPoint)
     {
         _model.StartPointDocking          = movePointDocking;
         _model.EndPointDocking            = otherPointDocking;
         _model.StartPointRelativePosition = ConnectorUtilities.ComputeRelativePosition(_model.From.Bounds, newMovePointPosition, _model.StartPointDocking);
         _model.EndPointRelativePosition   = ConnectorUtilities.ComputeRelativePosition(_model.To.Bounds, newOtherPointPosition, _model.EndPointDocking);
     }
     else if (MoveType == Types.MoveType.MoveMiddlePoint)
     {
         _model.MiddlePointRelativePosition = newDistance;
     }
     else if (MoveType == Types.MoveType.MoveEndPoint)
     {
         _model.StartPointDocking          = otherPointDocking;
         _model.EndPointDocking            = movePointDocking;
         _model.StartPointRelativePosition = ConnectorUtilities.ComputeRelativePosition(_model.From.Bounds, newOtherPointPosition, _model.StartPointDocking);
         _model.EndPointRelativePosition   = ConnectorUtilities.ComputeRelativePosition(_model.To.Bounds, newMovePointPosition, _model.EndPointDocking);
     }
 }
Esempio n. 2
0
 public void Commit(ConnectorDocking movePointDocking, ConnectorDocking otherPointDocking, Point newMovePointPosition, Point newOtherPointPosition, double newDistance)
 {
     if (_moveType == MoveType.MoveStartPoint)
     {
         _startingFrom.OutgoingDocking = movePointDocking;
         _endingAt.IncomingDocking     = otherPointDocking;
         if (movePointDocking != ConnectorDocking.Undefined)
         {
             _startingFrom.OutgoingRelativePosition = ConnectorUtilities.ComputeRelativePosition(_startingFrom.Bounds, newMovePointPosition, movePointDocking);
         }
         else
         {
             _startingFrom.OutgoingRelativePosition = 0.5;
             _endingAt.IncomingRelativePosition     = 0.5;
             _endingAt.MiddlePosition = 0.5;
         }
         //_model.EndPointRelativePosition = ConnectorUtilities.ComputeRelativePosition(_model.To.Bounds, newOtherPointPosition, _model.EndPointDocking);
     }
     else if (MoveType == MoveType.MoveMiddlePoint)
     {
         _startingFrom.MiddlePosition = newDistance;
     }
     else if (MoveType == MoveType.MoveEndPoint)
     {
         _startingFrom.OutgoingDocking = otherPointDocking;
         _endingAt.IncomingDocking     = movePointDocking;
         if (movePointDocking != ConnectorDocking.Undefined)
         {
             //_model.StartPointRelativePosition = ConnectorUtilities.ComputeRelativePosition(_model.From.Bounds, newOtherPointPosition, _model.StartPointDocking);
             _endingAt.IncomingRelativePosition = ConnectorUtilities.ComputeRelativePosition(_endingAt.Bounds, newMovePointPosition, movePointDocking);
         }
         else
         {
             _startingFrom.OutgoingRelativePosition = 0.5;
             _endingAt.IncomingRelativePosition     = 0.5;
             _endingAt.MiddlePosition = 0.5;
         }
     }
 }