private void OnRaiseValidationCompleteEvent(ValidationCompleteEventArgs 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. ValidationCompleteEventHandler raiseEvent = OnValidateComplete; // 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); } }
private void OnValidationComplete(ValidateEventArgs e) { ValidationCompleteEventHandler?.Invoke(this, e); // Invoke }