/// <summary>
 /// Begins connecting surface objects action.
 /// </summary>
 /// <param name="instigator">The connection instigator (eg. start box).</param>
 public void ConnectingStart(IConnectionInstigator instigator)
 {
     if (instigator != null && instigator != _connectionInstigator)
     {
         _connectionInstigator = instigator;
         StartMouseCapture();
     }
 }
        /// <summary>
        /// Ends connecting surface objects action.
        /// </summary>
        /// <param name="end">The end object (eg. end box).</param>
        public void ConnectingEnd(IConnectionInstigator end)
        {
            // Ensure that there was a proper start box
            if (_connectionInstigator == null)
            {
                return;
            }

            var start = _connectionInstigator;

            _connectionInstigator = null;

            // Check if boxes are different and end box is specified
            if (start == end || end == null)
            {
                return;
            }

            // Connect them
            if (start.CanConnectWith(end))
            {
                start.Connect(end);
            }
        }
 /// <summary>
 /// Callback for surface objects connections instigators to indicate mouse over control event (used to draw preview connections).
 /// </summary>
 /// <param name="instigator">The instigator.</param>
 public void ConnectingOver(IConnectionInstigator instigator)
 {
     _lastInstigatorUnderMouse = instigator;
 }