Exemplo n.º 1
0
        private AquosCommand(string command, string parameters = null, Television television = null)
        {
            if (string.IsNullOrEmpty(command))
            {
                throw new ArgumentNullException("command");
            }

            command = command.Trim();

            if (command.Length > CommandMaxLength)
            {
                throw new ArgumentException("Command cannot be more than four characters");
            }

            if (string.IsNullOrEmpty(parameters))
            {
                parameters = string.Empty;
            }

            parameters = parameters.Trim();

            if (parameters.Length > ParamMaxLength)
            {
                throw new ArgumentException("Command parameters cannot be more than four characters");
            }

            Command = command;
            Parameter = parameters.PadRight(ParamMaxLength);
            Television = television;
        }
Exemplo n.º 2
0
        public Form1()
        {
            InitializeComponent();

            _television = new Television("127.0.0.1", 8080);
        }
Exemplo n.º 3
0
 public static AquosCommand Power(PowerSetting setting, Television television = null)
 {
     return(new AquosCommand("POWR", Convert.ToString((int)setting), television));
 }
Exemplo n.º 4
0
 public static AquosCommand Volume(int value, Television television = null)
 {
     return(new AquosCommand("VOLM", Convert.ToString(value), television));
 }
Exemplo n.º 5
0
 public static AquosCommand Volume(int value, Television television = null)
 {
     return new AquosCommand("VOLM", Convert.ToString(value), television);
 }
Exemplo n.º 6
0
 public static AquosCommand Power(PowerSetting setting, Television television = null)
 {
     return new AquosCommand("POWR", Convert.ToString((int)setting), television);
 }
Exemplo n.º 7
0
        public Form1()
        {
            InitializeComponent();

            _television = new Television("127.0.0.1", 8080);
        }