Ejemplo n.º 1
0
 private void GoToChannelCommands()
 {
     if (command.Length > 3)
     {
         throw new ArgumentException("Wrong command");
     }
     else if ("down" == command[2].ToLower())
     {
         if (deviceList[command[0]] is IChannelable)
         {
             IChannelable device = (IChannelable)deviceList[command[0]];
             device.ChannelDown();
         }
         else
         {
             throw new ArgumentException("Wrong device");
         }
     }
     else if ("up" == command[2].ToLower())
     {
         if (deviceList[command[0]] is IChannelable)
         {
             IChannelable device = (IChannelable)deviceList[command[0]];
             device.ChannelUp();
         }
         else
         {
             throw new ArgumentException("Wrong device");
         }
     }
     else
     {
         throw new ArgumentException("Wrong command");
     }
 }