/// <summary> /// Initializes a new instance of the <see cref="Validator{T}"/> class that accepts any <typeparamref name="T"/> values. /// </summary> public Validator() { this.validators = new List <Func <T, Message> >(); this.ensure = new EnsureCollection(this); this.fail = new FailureCollection(this); }
/// <summary> /// This constructor is used when we just what non-violated named condition /// </summary> public Condition(string name) { if (name == null) { System.Diagnostics.Trace.WriteLine( Workshare.Reports.Properties.Resources.TRACE_NULL, "Condition Constructor 1" ); throw ( new ArgumentNullException( "name", Workshare.Reports.Properties.Resources.TRACE_NULL ) ); } m_name = name; m_rating = RatingType.None; m_fails = new FailureCollection(); }
/// <summary> /// This constructor is used when we have a condition that could be violated /// </summary> public Condition(Guid messageId, string name, string rating, string conditionType) { if (name == null || conditionType == null || rating == null) { System.Diagnostics.Trace.WriteLine( Workshare.Reports.Properties.Resources.TRACE_NULL, "Condition Constructor 2" ); throw ( new ArgumentNullException( "name, rating, conditionType", Workshare.Reports.Properties.Resources.TRACE_NULL ) ); } m_name = name; m_msgId = messageId; WorkoutType( rating ); if (m_rating != RatingType.None) m_isViolated = true; m_conditionType = conditionType; m_fails = new FailureCollection(); }
/// <summary> /// This constructor will create an empty class, normally /// used when the Node property is assigned /// </summary> public Condition(Guid id) { m_fails = new FailureCollection(); m_msgId = id; }