Ejemplo n.º 1
0
        public override bool Equals(object obj)
        {
            if (!base.Equals(obj))
            {
                return(false);
            }
            StringLengthConstraint stringLengthConstraint = obj as StringLengthConstraint;

            return(stringLengthConstraint.MinLength == this.MinLength && stringLengthConstraint.MaxLength == this.MaxLength);
        }
 private void CheckConstraintConsistency(PropertyDefinitionConstraint[] staticConstraints, PropertyDefinitionConstraint[] autogeneratedConstraints)
 {
     for (int i = 0; i < autogeneratedConstraints.Length; i++)
     {
         Type type = autogeneratedConstraints[i].GetType();
         for (int j = 0; j < staticConstraints.Length; j++)
         {
             Type type2 = staticConstraints[j].GetType();
             if (type2 != type)
             {
                 break;
             }
             if (typeof(StringLengthConstraint).GetTypeInfo().IsAssignableFrom(type.GetTypeInfo()))
             {
                 StringLengthConstraint stringLengthConstraint  = (StringLengthConstraint)autogeneratedConstraints[i];
                 StringLengthConstraint stringLengthConstraint2 = (StringLengthConstraint)staticConstraints[j];
             }
             else if (typeof(ByteArrayLengthConstraint).GetTypeInfo().IsAssignableFrom(type.GetTypeInfo()))
             {
                 ByteArrayLengthConstraint byteArrayLengthConstraint  = (ByteArrayLengthConstraint)autogeneratedConstraints[i];
                 ByteArrayLengthConstraint byteArrayLengthConstraint2 = (ByteArrayLengthConstraint)staticConstraints[j];
             }
             else if (typeof(RangedValueConstraint <ByteQuantifiedSize>).GetTypeInfo().IsAssignableFrom(type.GetTypeInfo()))
             {
                 RangedValueConstraint <ByteQuantifiedSize> rangedValueConstraint  = (RangedValueConstraint <ByteQuantifiedSize>)autogeneratedConstraints[i];
                 RangedValueConstraint <ByteQuantifiedSize> rangedValueConstraint2 = (RangedValueConstraint <ByteQuantifiedSize>)staticConstraints[j];
             }
             else if (typeof(RangedValueConstraint <int>).GetTypeInfo().IsAssignableFrom(type.GetTypeInfo()))
             {
                 RangedValueConstraint <int> rangedValueConstraint3 = (RangedValueConstraint <int>)autogeneratedConstraints[i];
                 RangedValueConstraint <int> rangedValueConstraint4 = (RangedValueConstraint <int>)staticConstraints[j];
             }
             else if (typeof(RangedValueConstraint <long>).GetTypeInfo().IsAssignableFrom(type.GetTypeInfo()))
             {
                 RangedValueConstraint <long> rangedValueConstraint5 = (RangedValueConstraint <long>)autogeneratedConstraints[i];
                 RangedValueConstraint <long> rangedValueConstraint6 = (RangedValueConstraint <long>)staticConstraints[j];
             }
         }
     }
 }