Catel.Data.ModelBase.SetDirtyAndAutomaticallyValidate C# (CSharp) 메소드

SetDirtyAndAutomaticallyValidate() 보호된 메소드

Sets the IsDirty property and automatically validate if required.
protected SetDirtyAndAutomaticallyValidate ( string propertyName, bool setDirtyAndAllowAutomaticValidation ) : void
propertyName string Name of the property.
setDirtyAndAllowAutomaticValidation bool If set to true, the property is set and automatic validation is allowed.
리턴 void
        protected virtual void SetDirtyAndAutomaticallyValidate(string propertyName, bool setDirtyAndAllowAutomaticValidation)
        {
            // Are we not validating or is this a warning or error message?
            if (setDirtyAndAllowAutomaticValidation && !IsValidating &&
                (string.CompareOrdinal(propertyName, WarningMessageProperty) != 0) &&
                (string.CompareOrdinal(propertyName, HasWarningsMessageProperty) != 0) &&
                (string.CompareOrdinal(propertyName, ErrorMessageProperty) != 0) &&
                (string.CompareOrdinal(propertyName, HasErrorsMessageProperty) != 0))
            {
                if (ShouldPropertyChangeUpdateIsDirty(propertyName))
                {
                    IsDirty = true;
                }

                IsValidated = false;
            }

            if (AutomaticallyValidateOnPropertyChanged && setDirtyAndAllowAutomaticValidation)
            {
                Validate();
            }
        }
        #endregion