public void Connect(Node node) { if (SourceNode == null) { SourceNode = node; SourceNode.IsSelected = true; } else { if (!SourceNode.Equals(node) && SourceNode.GroupId < node.GroupId && SourceNode.GroupId + 1 == node.GroupId) { Connection connection = new Connection(SourceNode, node); _graphCanvas.Children.Add(connection); SourceNode.Children.Add(node); ClearSelection(); } else { if (SourceNode.GroupId == node.GroupId && !SourceNode.Equals(node)) { ClearSelection(); SourceNode = node; SourceNode.IsSelected = true; } else { ClearSelection(); } } } }
/// <summary> /// Determines whether the specified <see cref="System.Object" /> is equal to this instance. /// </summary> public override bool Equals(object obj) { if (obj == null) { return(false); } Token tOther = (Token)obj; return(SourceNode.Equals(tOther.SourceNode) && IsClose.Equals(tOther.IsClose)); }
public override bool Equals(object obj) { SourceAndEventTypeKey other = obj as SourceAndEventTypeKey; if (other != null) { return(SourceNode.Equals(other.SourceNode) && EventType.Equals(other.EventType)); } return(base.Equals(obj)); }