예제 #1
0
 public void Validate(List <Segment> segments)
 {
     foreach (Segment segToCheck in segments)
     {
         NumericProperty valToCheck = (NumericProperty)segToCheck[valueName];
         if (valToCheck != null)
         {
             if (valToCheck.Value <= threshold)
             {
                 if (correctErrors)
                 {
                     segToCheck.Exclude = true;
                 }
                 segToCheck.AddError(valueName + "(" + valToCheck.Value + ") was not greater than " + threshold.ToString() + ".");
             }
         }
         else
         {
             if (correctErrors)
             {
                 segToCheck.Exclude = true;
             }
             segToCheck.AddError("Missing property (" + valueName + ")");
         }
     }
 }
예제 #2
0
        public override bool Equals(object obj)
        {
            bool equal = false;

            if (obj.GetType().Name == "NumericProperty")
            {
                NumericProperty other = (NumericProperty)obj;
                equal = (other.Label == this.Label) && (other.Value == this.Value);
            }
            else
            {
                equal = base.Equals(obj);
            }
            return(equal);
        }