Пример #1
0
 /// <summary>
 /// Connect the device to a port
 /// </summary>
 /// <param name="port">Any output port on brick</param>
 public void Connect(OutputPort port)
 {
     if (Brick.IsConnected)
     {
         throw new InvalidOperationException("Can not connect devices after connection to the brick is made!");
     }
     if (IsConnected)
     {
         throw new InvalidOperationException("Can not reconnect devices to other ports!");
     }
     port.Set(this);
 }