internal void FErrorWindowInit(int ErrId, string FriendlyDesc, FErrorSeverity ErrorSeverity, Exception UnfriendlyDesc = null) { _InternalErrorSeverity = ErrorSeverity; this.Error_FriendlyDesc.Text = FriendlyDesc; if (UnfriendlyDesc != null) { this.Error_UnfriendlyDesc.Text = $"{UnfriendlyDesc.ToString()} (Error # {ErrId})"; } // Final stage of constructor: Error Window Setup based on ErrorSeverity switch (_InternalErrorSeverity) { case FErrorSeverity.Notification: this.Height = 195; Error_Error.Text = "Notification"; Error_OKButton.Margin = new Thickness(532, 108, 0, 0); Error_OKButton.Content = "Continue"; this.Grid.Children.Remove(Error_UnfriendlyDesc); return; case FErrorSeverity.Warning: this.Height = 195; Error_Error.Text = "Warning"; Error_OKButton.Margin = new Thickness(532, 108, 0, 0); Error_OKButton.Content = "Continue"; this.Grid.Children.Remove(Error_UnfriendlyDesc); return; case FErrorSeverity.Error: this.Height = 195; Error_Error.Text = "Error"; Error_OKButton.Margin = new Thickness(532, 108, 0, 0); Error_OKButton.Content = "Continue"; this.Grid.Children.Remove(Error_UnfriendlyDesc); return; case FErrorSeverity.FatalError: this.Title = "Fuchsia has crashed."; Error_Error.Text = "Fuchsia has crashed."; Error_Error.FontSize = 48; Error_Occurred.Text = "We're sorry! Please report the detailed .NET exception information below."; Error_Occurred.Width = this.Width; Error_OKButton.Content = "Exit"; return; } }
public FuchsiaError(int ErrId, string FriendlyDesc, FErrorSeverity ErrorSeverity, Exception UnfriendlyDesc = null) { InitializeComponent(); FErrorWindowInit(ErrId, FriendlyDesc, ErrorSeverity, UnfriendlyDesc); }
public static void ThrowError(int ErrId, string FriendlyDesc, FErrorSeverity ErrorSeverity, Exception UnfriendlyDesc = null) { FuchsiaError FuchsiaError = new FuchsiaError(ErrId, FriendlyDesc, ErrorSeverity, UnfriendlyDesc); FuchsiaError.ShowDialog(); }