Пример #1
0
        protected virtual void OnValidationError(ValidationErrorEventArgs args)
        {
            ValidationErrorEventHandler errorEventHandler = (ValidationErrorEventHandler)this.Events[EditorBaseElement.ValidationErrorEventKey];

            if (errorEventHandler == null)
            {
                return;
            }
            errorEventHandler((object)this, args);
        }
Пример #2
0
        protected virtual void OnValidationError(ValidationErrorEventArgs args)
        {
            ValidationErrorEventHandler handler1 =
                (ValidationErrorEventHandler)base.Events[ValidationErrorEventKey];;

            if (handler1 != null)
            {
                handler1(this, args);
            }
        }
Пример #3
0
        private void OnRaiseValidationErrorEvent(ValidationErrorEventArgs e)
        {
            // Make a temporary copy of the event to avoid possibility of
            // a race condition if the last subscriber unsubscribes
            // immediately after the null check and before the event is raised.
            ValidationErrorEventHandler raiseEvent = OnValidateError;

            // Event will be null if there are no subscribers
            if (raiseEvent != null)
            {
                // Format the string to send inside the CustomEventArgs parameter
                // e.Message += $" at {DateTime.Now}";

                // Call to raise the event.
                raiseEvent(this, e);
            }
        }