示例#1
0
        // Fired when a new command has arrived.
        // If a command is returned it will be sont back.
        public Command OnCommand(Command command)
        {
            // Make sure we have the program
            if (!m_programCache.ContainsKey(command.Program))
            {
                return(null);
            }

            // Check the version is current
            if (command.Version != Command.COMMAND_VERSION)
            {
                System.Diagnostics.Debug.WriteLine("A old message was thrown away.");
                return(null);
            }

            // Get the program
            IProgram program = m_programCache[command.Program];

            // Send the commands
            return(program.CommandRecieved(command));
        }