public Connection(IGraphNode start, IGraphNode end) { if (start.Equals(Activity.End)) { throw new Exception("Forbidden: END node cannot be connection's start node."); } if (end.Equals(Activity.Start)) { throw new Exception("Forbidden: START node cannot be connection's end node."); } Validate(start, end); startNode = start; start.RegisterConnection(this); endNode = end; end.RegisterConnection(this); }