Exemple #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);
        }
Exemple #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));
 }
 /// <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);
 }
 /// <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;
 }
 /// <summary>
 /// Clear all subscriptions to the given command
 /// </summary>
 /// <param name="command"></param>
 public void ClearSubscriptions(NetCommand command)
 {
     ClearSubscriptions(command.Name);
 }
 /// <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;
 }
 /// <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;
 }
 /// <summary>
 /// Initialize a new instance of this command with the provided command
 /// </summary>
 /// <param name="command"></param>
 public CommandStatusChangedEventArgs(NetCommand command)
 {
     Command = command;
 }