ABsoluteMaybe.SampleWebsite.MVC2.Models.PropertiesMustMatchAttribute.IsValid C# (CSharp) Method

IsValid() public method

public IsValid ( object value ) : bool
value object
return bool
        public override bool IsValid(object value)
        {
            PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(value);
            object originalValue = properties.Find(OriginalProperty, true /* ignoreCase */).GetValue(value);
            object confirmValue = properties.Find(ConfirmProperty, true /* ignoreCase */).GetValue(value);
            return Object.Equals(originalValue, confirmValue);
        }