/// <summary>
        /// Schedules the provided command for All Clients provided for All Schedules
        /// </summary>
        /// <param name="id"></param>
        /// <param name="commandToExecute"></param>
        /// <param name="clientIds"></param>
        /// <param name="scheduleInstructions"></param>
        /// <param name="aggId"></param>
        /// <param name="version"></param>
        public ScheduleCommand(Guid id, CommandToExecute commandToExecute, List <int> clientIds, List <ScheduleInstruction> scheduleInstructions, Guid aggId, int version) : base(aggId, version)
        {
            if ((clientIds == null || clientIds.Count == 0) || (scheduleInstructions == null || scheduleInstructions.Count == 0))
            {
                throw new ArgumentException("Atlease 1 client id and schedule instruction is required for this commad.");
            }

            CommandToExecute      = commandToExecute;
            _clientIds            = clientIds;
            _scheduleInstructions = scheduleInstructions;
            Id = id;
        }
Beispiel #2
0
 private void AssociatedObjectMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
 {
     if (!_timer.IsEnabled)
     {
         // If the timer is not already running then start it.
         _timer.Start();
     }
     else
     {
         _timer.Stop();
         if (CommandToExecute != null)
         {
             // If the timer is active there has been a second event so execute the command.
             CommandToExecute.Execute(this);
         }
     }
 }
Beispiel #3
0
 public override void Draw()
 {
     CommandToExecute.Execute();
 }
 public CommandScheduled(CommandToExecute commandToExecute, int clientId, ScheduleInstruction scheduleInstruction) : base()
 {
     CommandToExecute     = commandToExecute;
     ClientId             = clientId;
     ScheduleInstructions = scheduleInstruction;
 }