示例#1
0
        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);
        }
示例#2
0
 protected Component()
 {
     establisher       = new ConnectionEstablisher(this);
     requireComponents = new List <Type>();
 }