Skip to content

Commit abdfaac

Browse files
committed
Refactoring.
1 parent 68d4cb5 commit abdfaac

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

Constants.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ class Constants
1010

1111
public const string HomepageUrl = "https://github.com/KN4CK3R/ReClass.NET";
1212

13+
public const string HelpUrl = "https://github.com/KN4CK3R/ReClass.NET/issues";
14+
1315
#if WIN64
1416
public const string Platform = "x64";
1517
#else

Forms/LogForm.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,7 @@ private void ShowDetailsForm()
119119
{
120120
if (item.Exception != null)
121121
{
122-
item.Exception.HelpLink = "https://github.com/KN4CK3R/ReClass.NET/issues";
123-
124-
var msg = new ExceptionMessageBox(item.Exception);
125-
msg.ShowToolBar = true;
126-
msg.Symbol = ExceptionMessageBoxSymbol.Error;
127-
msg.Show(null);
122+
Program.ShowException(item.Exception);
128123
}
129124
}
130125
}

Program.cs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
using System;
22
using System.Globalization;
33
using System.Windows.Forms;
4+
using Microsoft.SqlServer.MessageBox;
45
using ReClassNET.Forms;
56
using ReClassNET.Logger;
67
using ReClassNET.Memory;
78
using ReClassNET.UI;
8-
using ReClassNET.Util;
99

1010
namespace ReClassNET
1111
{
@@ -50,7 +50,7 @@ static void Main()
5050
}
5151
catch (Exception ex)
5252
{
53-
ex.ShowDialog();
53+
ShowException(ex);
5454
}
5555
#else
5656
using (var nativeHelper = new NativeHelper())
@@ -63,5 +63,17 @@ static void Main()
6363

6464
Settings.Save(settings, Constants.SettingsFile);
6565
}
66+
67+
/// <summary>Shows the exception in a special form.</summary>
68+
/// <param name="ex">The exception.</param>
69+
public static void ShowException(Exception ex)
70+
{
71+
ex.HelpLink = Constants.HelpUrl;
72+
73+
var msg = new ExceptionMessageBox(ex);
74+
msg.ShowToolBar = true;
75+
msg.Symbol = ExceptionMessageBoxSymbol.Error;
76+
msg.Show(null);
77+
}
6678
}
6779
}

0 commit comments

Comments
 (0)