コード例 #1
0
        /// <summary>
        /// Moves to the next command
        /// </summary>
        /// <returns></returns>
        public bool MoveNext()
        {
            if (Active != null)
            {
                return(true);
            }

            for (int i = 0; i < _Items.Count; i++)
            {
                NetCommand command = this[i, true];
                if (command.Status == CommandStatus.Waiting)
                {
                    Active = command;
                    break;
                }
            }

            return(Active != null);
        }
コード例 #2
0
 /// <summary>
 /// Checks that is command is a server command
 /// </summary>
 /// <param name="command"></param>
 /// <returns></returns>
 public bool IsServerCommand(NetCommand command)
 {
     return(IsServerCommand(command.Id));
 }
コード例 #3
0
 /// <summary>
 /// Subscribe given method handler to the given command name
 /// </summary>
 /// <param name="command"></param>
 /// <param name="methodHandler"></param>
 public void Subscribe(NetCommand command, CommandExecuteHandler methodHandler)
 {
     Subscribe(command.Name, methodHandler);
 }
コード例 #4
0
 /// <summary>
 /// Publish a command executed to the subscriptions
 /// </summary>
 /// <param name="command"></param>
 public void PublishCommandExecute(NetCommand command)
 {
     Publish(command.Name, command);
     Publish(ALL_COMMAND_NAME_PREFIX, command);
     command.Status = CommandStatus.Executed;
 }
コード例 #5
0
 /// <summary>
 /// Clear all subscriptions to the given command
 /// </summary>
 /// <param name="command"></param>
 public void ClearSubscriptions(NetCommand command)
 {
     ClearSubscriptions(command.Name);
 }
コード例 #6
0
 /// <summary>
 /// Initialize a new instance of this command with the provided command, old status and status changed date
 /// </summary>
 /// <param name="command"></param>
 /// <param name="old"></param>
 /// <param name="date"></param>
 public CommandStatusChangedEventArgs(NetCommand command, CommandStatus old,
                                      DateTime date)
     : this(command, old)
 {
     Date = date;
 }
コード例 #7
0
 /// <summary>
 /// Initialize a new instance of this command with the provided command and old status
 /// </summary>
 /// <param name="command"></param>
 /// <param name="old"></param>
 public CommandStatusChangedEventArgs(NetCommand command, CommandStatus old)
     : this(command)
 {
     OldStatus = old;
 }
コード例 #8
0
 /// <summary>
 /// Initialize a new instance of this command with the provided command
 /// </summary>
 /// <param name="command"></param>
 public CommandStatusChangedEventArgs(NetCommand command)
 {
     Command = command;
 }