Exemplo n.º 1
0
        /// <summary>
        /// Handles a show error event raised by a sender.
        /// Bubbles up the event to the ShowErrorEventHandler.
        /// </summary>
        /// <param name="sender">sender of event</param>
        /// <param name="e">show message event arguments</param>
        protected virtual void HandleShowError(object sender, ShowMessageEventArgs e)
        {
            ShowErrorEventHandler handler = this.ShowError;

            if (handler != null)
            {
                handler(this, e);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Raises this object's show error event.
        /// </summary>
        /// <param name="errorMessage">error message</param>
        /// <param name="caption">caption</param>
        /// <param name="supplementMsg">supplemental message</param>
        protected virtual void OnShowError(string errorMessage, string caption = null, string supplementMsg = null)
        {
            ShowErrorEventHandler handler = this.ShowError;

            if (handler != null)
            {
                var args = new ShowMessageEventArgs(errorMessage, caption, supplementMsg);
                handler(this, args);
            }
        }