Пример #1
0
        protected virtual void OnMouseUp(MouseUpEvent e)
        {
            if (!m_Active || !CanStopManipulation(e))
            {
                return;
            }

            try
            {
                if (CanPerformConnection(e.localMousePosition))
                {
                    m_EdgeDragHelper.HandleMouseUp(e, true, Enumerable.Empty <Edge>(), Enumerable.Empty <IPortModel>());
                }
                else
                {
                    Abort();
                }
            }
            finally
            {
                m_Active = false;
                target.ReleaseMouse();
                e.StopPropagation();
            }
        }
Пример #2
0
 protected void OnMouseUp(MouseUpEvent evt)
 {
     if (CanStopManipulation(evt))
     {
         target.ReleaseMouse();
         if (m_Active)
         {
             if (m_AdditionalEdgeDragHelpers != null)
             {
                 m_ConnectedEdgeDragHelper.HandleMouseUp(evt, true, m_AdditionalEdgeDragHelpers.Select(t => t.originalEdge), m_AdditionalEdgeDragHelpers.Select(t => t.draggedPort));
                 foreach (var dragHelper in m_AdditionalEdgeDragHelpers)
                 {
                     dragHelper.HandleMouseUp(evt, false, Enumerable.Empty <Edge>(), Enumerable.Empty <IPortModel>());
                 }
             }
             else
             {
                 m_ConnectedEdgeDragHelper.HandleMouseUp(evt, true, Enumerable.Empty <Edge>(), Enumerable.Empty <IPortModel>());
             }
         }
         Reset();
         evt.StopPropagation();
     }
 }