예제 #1
0
            public IDataValidationErrors Add(DataValidationError value)
            {
                value.VerifyNotNull(nameof(value));

                if (!IsSealed)
                {
                    _list.Add(value);
                    return(this);
                }

                if (Count == 0)
                {
                    return(value);
                }
                else
                {
                    var result = new ListGroup();
                    for (int i = 0; i < Count; i++)
                    {
                        result.Add(this[i]);
                    }
                    result.Add(value);
                    return(result);
                }
            }
예제 #2
0
 public ListGroup(DataValidationError value1, DataValidationError value2)
 {
     Debug.Assert(value1 != null && value2 != null);
     Add(value1);
     Add(value2);
 }
예제 #3
0
 internal static IDataValidationErrors New(DataValidationError value1, DataValidationError value2)
 {
     Debug.Assert(value1 != null && value2 != null && value1 != value2);
     return(new ListGroup(value1, value2));
 }
예제 #4
0
 public IDataValidationErrors Add(DataValidationError value)
 {
     value.VerifyNotNull(nameof(value));
     return(value);
 }
예제 #5
0
 IDataValidationErrors IDataValidationErrors.Add(DataValidationError value)
 {
     value.VerifyNotNull(nameof(value));
     return(DataValidationErrors.New(this, value));
 }