Пример #1
0
        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));
 }
Пример #3
0
 public ModifierFacade(IRuleModifier modifier) : this(modifier, ModifierKind.Rule, modifier.Stringify)
 {
 }