public Rule(RuleTrigger trigger, RuleAction action) { Guard.NotNull(trigger); Guard.NotNull(action); SetTrigger(trigger); SetAction(action); }
public Rule(RuleTrigger trigger, RuleAction action) { Guard.NotNull(trigger, nameof(trigger)); Guard.NotNull(action, nameof(action)); this.trigger = trigger; this.action = action; }
public Rule(RuleTrigger trigger, RuleAction action) { Guard.NotNull(trigger); Guard.NotNull(action); Action = action; Trigger = trigger; }
public Rule(RuleTrigger trigger, RuleAction action) { Guard.NotNull(trigger); Guard.NotNull(action); this.trigger = trigger; this.trigger.Freeze(); this.action = action; this.action.Freeze(); }
public void Update(RuleAction newAction) { Guard.NotNull(newAction, nameof(newAction)); if (newAction.GetType() != action.GetType()) { throw new ArgumentException("New action has another type.", nameof(newAction)); } action = newAction; }
public Rule Update(RuleAction newAction) { Guard.NotNull(newAction, nameof(newAction)); if (newAction.GetType() != action.GetType()) { throw new ArgumentException("New action has another type.", nameof(newAction)); } return(Clone(clone => { clone.action = newAction; })); }
public Rule Update(RuleAction newAction) { Guard.NotNull(newAction); if (newAction.GetType() != action.GetType()) { throw new ArgumentException("New action has another type.", nameof(newAction)); } if (action.DeepEquals(newAction)) { return(this); } return(Clone(clone => { clone.SetAction(newAction); })); }
private void SetAction(RuleAction newAction) { action = newAction; action.Freeze(); }
public bool DeepEquals(RuleAction action) { return(SimpleEquals.IsEquals(this, action)); }
public bool DeepEquals(RuleAction action) { return(this.WithDeepEqual(action).IgnoreProperty <Freezable>(x => x.IsFrozen).Compare()); }