public void AttachConnector(IConnector connector) { if(connector == null) return; //only attach'm if not already present and not the parent if(!attachedConnectors.Contains(connector) && connector!=attachedTo) { connector.DetachFromParent(); attachedConnectors.Add(connector); //make sure the attached connector is centered at this connector connector.Point = this.point; connector.AttachedTo = this; } }
/// <summary> /// Attaches the given connector to this connector. /// <remarks>The method will remove a previous binding, if any, before creating the attachment. This method prohibits mutliple identical connections; /// you can attach a connector only once. /// </remarks> /// </summary> /// <param name="connector"></param> public void AttachConnector(IConnector connector) { if (connector == null || !Enabled) { return; } //only attach'm if not already present and not the parent if (!attachedConnectors.Contains(connector) && connector != attachedTo) { connector.DetachFromParent(); attachedConnectors.Add(connector); //make sure the attached connector is centered at this connector connector.Point = this.mPoint; connector.AttachedTo = this; } }
// ------------------------------------------------------------------ /// <summary> /// Attaches the given connector to this connector. /// <remarks>The method will remove a previous binding, if any, /// before creating the attachment. This method prohibits mutliple /// identical connections; you can attach a connector only once. /// </remarks> /// </summary> /// <param name="connector">IConnector</param> // ------------------------------------------------------------------ public virtual void AttachConnector(IConnector connector) { if (connector == null || !Enabled) return; //only attach'm if not already present and not the parent if ((!mAttachedConnectors.Contains(connector)) && (connector != mAttachedTo)) { connector.DetachFromParent(); mAttachedConnectors.Add(connector); // Make sure the attached connector is centered at this // connector. connector.Point = this.mPoint; connector.AttachedTo = this; } }