public Component TryToConnect(Component target, ConnectionInterface connectionInterface) { ConnectionEstablisher targetEstablisher = target.Establisher; if (HasFreeConnectionInterface(connectionInterface) && targetEstablisher.HasFreeConnectionInterface(connectionInterface)) { targetEstablisher.AddConnection(belongs, connectionInterface); AddConnection(target, connectionInterface); return(target); } return(null); }
protected Component() { establisher = new ConnectionEstablisher(this); requireComponents = new List <Type>(); }