internal Connection(NamedConnection onlyConnection) { namedConnections = new HashSet <NamedConnection> { onlyConnection }; }
internal Connection(NamedConnection onlyConnection, string connectionId) { namedConnections = new HashSet <NamedConnection> { onlyConnection }; ConnectionId = connectionId; }
internal void ConnectTo(NamedConnection other) { // Add all connections 'other' points to namedConnections.UnionWith(other.Connection.NamedConnections); // Set all connections 'other' is connected to to point to this connection var previousConnections = other.Connection.NamedConnections; foreach (var c in previousConnections) { c.Connection = this; } }
internal void ConnectTo(NamedConnection other) { // Unset the connection ID if the other connection has a different ID if (other.Connection.ConnectionId != null && other.Connection.ConnectionId != ConnectionId) { ConnectionId = null; } // Add all connections 'other' points to namedConnections.UnionWith(other.Connection.NamedConnections); // Set all connections 'other' is connected to to point to this connection var previousConnections = other.Connection.NamedConnections; foreach (var c in previousConnections) { c.Connection = this; } }
public void ConnectTo(NamedConnection other) => Connection.ConnectTo(other);
internal void Disconnect(NamedConnection namedConnection) { namedConnections.Remove(namedConnection); }