/// <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; }
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); } } }
public override void Draw() { CommandToExecute.Execute(); }
public CommandScheduled(CommandToExecute commandToExecute, int clientId, ScheduleInstruction scheduleInstruction) : base() { CommandToExecute = commandToExecute; ClientId = clientId; ScheduleInstructions = scheduleInstruction; }