Exemple #1
0
        public Rule Update(RuleTrigger newTrigger)
        {
            Guard.NotNull(newTrigger);

            if (newTrigger.GetType() != trigger.GetType())
            {
                throw new ArgumentException("New trigger has another type.", nameof(newTrigger));
            }

            newTrigger.Freeze();

            return(Clone(clone =>
            {
                clone.trigger = newTrigger;
            }));
        }
Exemple #2
0
 private void SetTrigger(RuleTrigger newTrigger)
 {
     trigger = newTrigger;
     trigger.Freeze();
 }