Ejemplo n.º 1
0
 private bool ContainsSameActionTypeAsControlAction(QueueControl control)
 {
     if (ControlAction is SimpleControlAction)
         return control.SimpleActions.Any(HaveSameNameAsControlAction);
     if (ControlAction is SlidingControlAction)
         return control.SlidingActions.Any(HaveSameNameAsControlAction);
     throw new ArgumentException($"Encountered unknown ControlAction type {ControlAction.GetType()}");
 }
Ejemplo n.º 2
0
 private QueueControl GetFirstControlWhichSupportsActionOrNull(QueueControl[] controls)
 {
     var control = controls.FirstOrDefault(ContainsSameActionTypeAsControlAction);
     if (control == null)
     {
         LogWarning($"No control could be found that supports the action '{ControlAction.Name}'");
     }
     return control;
 }
Ejemplo n.º 3
0
 public QueueItem(QueueControl control, ControlAction action)
 {
     Control = control;
     Action = action;
 }
Ejemplo n.º 4
0
 private bool DoesDeviceHaveControlInAnActionGroup(
     QueueControl[] controls,
     GroupedActionsToBeQueued[] actionGroups)
 {
     return controls.Any(control => actionGroups.Any(g => g.ActionToBeQueued.Control.ControlId == control.ControlId));
 }
Ejemplo n.º 5
0
 public ActionToBeQueued(QueueControl control, ControlAction action)
 {
     Control = control;
     Action = action;
 }