/// <summary> /// Initializes a new instance of the <see cref="CollectionCondition"/> class. /// </summary> protected CollectionCondition(ConditionCollection prerequisites) : base( prerequisites.ObserveIsSatisfiedChanged(), () => prerequisites.IsSatisfied) { this.prerequisites = prerequisites; this.prerequisites.CollectionChanged += this.OnPreRequisitesChanged; }
/// <summary> /// Initializes a new instance of the <see cref="CollectionCondition"/> class. /// </summary> /// <param name="prerequisites">The children.</param> protected CollectionCondition(ConditionCollection prerequisites) #pragma warning disable GUREA02 // Observable and criteria must match. : base( prerequisites.ObserveIsSatisfiedChanged(), () => prerequisites.IsSatisfied) #pragma warning restore GUREA02 // Observable and criteria must match. { this.prerequisites = prerequisites ?? throw new System.ArgumentNullException(nameof(prerequisites)); prerequisites.CollectionChanged += this.OnPreRequisitesChanged; }
protected Condition(ConditionCollection conditionCollection) : this(conditionCollection.ObserveIsSatisfiedChanged(), () => conditionCollection.IsSatisfied) { Ensure.NotNullOrEmpty(conditionCollection, nameof(conditionCollection)); this.prerequisites = conditionCollection; }