Ejemplo n.º 1
0
 public void DeleteCurrentConnection()
 {
     if (this.m_ActiveConnection != null)
     {
         if (!this.m_ActiveConnection.HasElement(typeof(Light)))
         {
             OnElementMoveDelegate delegate2 = this.m_ActiveConnection.Element1.CanMove(this.m_ActiveConnection.PointCenter);
             if (delegate2 != null)
             {
                 this.m_ActiveConnection.PointCenter = this.m_ActiveConnection.Element1.Center;
             }
             else
             {
                 delegate2 = this.m_ActiveConnection.Element2.CanMove(this.m_ActiveConnection.PointCenter);
                 this.m_ActiveConnection.PointCenter = this.m_ActiveConnection.Element2.Center;
             }
             delegate2(this.m_ActiveConnection.PointCenter);
         }
         this.m_ActiveConnection.Element1.Disconnect(this.m_ActiveConnection);
         this.m_ActiveConnection.Element2.Disconnect(this.m_ActiveConnection);
         this.m_Layout.Connections.Remove(this.m_ActiveConnection);
         this.m_ActiveConnection = null;
         this.Invalidate();
     }
 }
Ejemplo n.º 2
0
 public void Disconnect(Connection c)
 {
     Debug.Assert(this.m_Connections.Contains(c));
     this.m_Connections.Remove(c);
 }
Ejemplo n.º 3
0
 protected virtual bool FindActiveContext(Point p)
 {
     if (this.GetLayout() == null)
     {
         return false;
     }
     string toolTipText = "";
     this.m_ActiveConnection = null;
     this.m_ActiveElement = null;
     if (!this.m_bReadOnly)
     {
         foreach (Connection connection in this.GetLayout().Connections)
         {
             if (connection.HasElement(this.m_alElTypes) && (connection.CanMove(p) != null))
             {
                 this.m_ActiveConnection = connection;
                 toolTipText = this.m_ActiveConnection.GetToolTipText(true, p);
                 break;
             }
         }
     }
     foreach (Element element in this.GetLayout().Elements)
     {
         if (this.m_alElTypes.Contains(element.GetType()) && (Element.IsPtCaptured(p, element.GetCenterPoint()) || (element.CanMove(p) != null)))
         {
             this.m_ActiveElement = element;
             if (toolTipText.Length == 0)
             {
                 toolTipText = this.m_ActiveElement.GetToolTipText(!this.m_bReadOnly, p);
             }
             break;
         }
     }
     return ((this.m_ActiveConnection != null) || (this.m_ActiveElement != null));
 }
Ejemplo n.º 4
0
 public void Connect(Connection c)
 {
     Debug.Assert(!this.m_Connections.Contains(c));
     this.m_Connections.Add(c);
 }