C# Class ERP.ErrorWindow

ChildWindow class that displays errors to the user.
Inheritance: System.Windows.Controls.ChildWindow
Exibir arquivo Open project: arthurgfonseca/ERP-Grupo5 Class Usage Examples

Private Properties

Property Type Description
ConvertExceptionToMessage string
CreateNew void
InitializeComponent void
OKButton_Click void

Public Methods

Method Description
CreateNew ( Exception exception ) : void

Creates a new Error Window given an exception. Current stack trace will be displayed if app is running under debug or on the local machine The exception is converted onto a message using ConvertExceptionToMessage

CreateNew ( Exception exception, StackTracePolicy policy ) : void

Creates a new Error Window given an exception. The exception is converted onto a message using ConvertExceptionToMessage

CreateNew ( string message ) : void

Creates a new Error Window given an error message. Current stack trace will be displayed if app is running under debug or on the local machine.

CreateNew ( string message, StackTracePolicy policy ) : void

Creates a new Error Window given an error message.

Protected Methods

Method Description
ErrorWindow ( string message, string errorDetails ) : System

Creates a new ErrorWindow instance.

Private Methods

Method Description
ConvertExceptionToMessage ( Exception e ) : string

Creates a user friendly message given an Exception. Currently this simply takes the Exception.Message value, optionally but you might want to change this to treat some specific Exception classes differently

CreateNew ( string message, string stackTrace, StackTracePolicy policy ) : void

All other factory methods will result in a call to this one

InitializeComponent ( ) : void
OKButton_Click ( object sender, RoutedEventArgs e ) : void

Method Details

CreateNew() public static method

Creates a new Error Window given an exception. Current stack trace will be displayed if app is running under debug or on the local machine The exception is converted onto a message using ConvertExceptionToMessage
public static CreateNew ( Exception exception ) : void
exception System.Exception The exception to display.
return void

CreateNew() public static method

Creates a new Error Window given an exception. The exception is converted onto a message using ConvertExceptionToMessage
public static CreateNew ( Exception exception, StackTracePolicy policy ) : void
exception System.Exception The exception to display.
policy StackTracePolicy When to display the stack trace, see .
return void

CreateNew() public static method

Creates a new Error Window given an error message. Current stack trace will be displayed if app is running under debug or on the local machine.
public static CreateNew ( string message ) : void
message string The message to display.
return void

CreateNew() public static method

Creates a new Error Window given an error message.
public static CreateNew ( string message, StackTracePolicy policy ) : void
message string The message to display.
policy StackTracePolicy When to display the stack trace, see .
return void

ErrorWindow() protected method

Creates a new ErrorWindow instance.
protected ErrorWindow ( string message, string errorDetails ) : System
message string The error message to display.
errorDetails string Extra information about the error.
return System