/// <summary> /// Creates and registers a constraint that automatically enables the editor for the item <paramref name="target"/> /// iff the value in the editor for <paramref name="source"/> has the value <paramref name="value"/>. /// </summary> /// <param name="source"></param> /// <param name="value"></param> /// <param name="target"></param> public void SetEnabledOnValueEquals(IOptionItem source, object value, IOptionItem target) { IConstraint constraint = new ConditionActionConstraint(CreateValueEqualsCondition(source, value), new SetEnabledAction(target)); AddConstraint(constraint); }
/// <summary> /// Creates and registers a constraint that automatically enables the editor for the item <paramref name="target"/> /// iff the condition <paramref name="cond"/> becomes true. /// </summary> /// <param name="cond"></param> /// <param name="target">New constraint that automatically enables the editor for the item <paramref name="target"/> /// iff the condition <paramref name="cond"/> becomes true</param> public void SetEnabledOnCondition(ICondition cond, IOptionItem target) { IConstraint constraint = new ConditionActionConstraint(cond, new SetEnabledAction(target)); AddConstraint(constraint); }