public static string Stringify(this IRuleModifier m) { switch (m.Action) { case RuleModifierAction.Hide: case RuleModifierAction.Show: return(m.Action.ToString()); case RuleModifierAction.Set: return($"{m.Action} '{m.Field}' to '{m.Value}'"); case RuleModifierAction.Append: return($"{m.Action} '{m.Field}' with '{m.Value}'"); default: throw new ArgumentOutOfRangeException(); } }
public static ModifierFacade ToFacade(this IRuleModifier modifier) { return(new ModifierFacade(modifier)); }
public ModifierFacade(IRuleModifier modifier) : this(modifier, ModifierKind.Rule, modifier.Stringify) { }