public void AddTrigger(IDynamicCondition dynamicCondition, IDynamicAction action) { foreach (var type in dynamicCondition.EventType) { List <Trigger> list; if (!triggers.TryGetValue(type, out list)) { list = new List <Trigger>(); triggers.Add(type, list); } list.Add(new Trigger { Action = action, DynamicCondition = dynamicCondition }); } }
/// <summary> /// Initializes a new instance of the <see cref="ActionInvokingCommand"/> class. /// </summary> /// <param name="action">The action.</param> /// <param name="condition">The condition.</param> public ActionInvokingCommand(Action <object> action, IDynamicCondition condition) : this(action) { Condition = condition; }
/// <summary> /// Initializes a new instance of the <see cref="ConditionalCommand"/> class. /// </summary> /// <param name="canExecuteCondition">The condition that decides if the command can execute.</param> protected ConditionalCommand(IDynamicCondition canExecuteCondition) { Condition = canExecuteCondition; }