Skip to content

Commit 45ea700

Browse files
PhyxionNLejsmith
authored andcommitted
Fixes #224
1 parent 6d2f453 commit 45ea700

File tree

2 files changed

+0
-36
lines changed

2 files changed

+0
-36
lines changed

src/Platforms/Exceptionless.Wpf/Exceptionless.Wpf.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
<Description>Exceptionless client for WPF applications. $(Description)</Description>
1616
<PackageTags>WPF;Exceptionless;Error;Report;Reporting;Exception;Logging;Log;ELMAH</PackageTags>
1717
<UseWPF>true</UseWPF>
18-
<UseWindowsForms>true</UseWindowsForms>
1918
<RootNamespace>Exceptionless</RootNamespace>
2019
<OutputType>Library</OutputType>
2120
</PropertyGroup>

src/Platforms/Exceptionless.Wpf/ExceptionlessClientExtensions.cs

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,11 @@
11
using System;
2-
using System.Threading;
32
using System.Windows.Threading;
43
using Exceptionless.Dependency;
54
using Exceptionless.Plugins;
65
using Exceptionless.Logging;
76

87
namespace Exceptionless.Wpf.Extensions {
98
public static class ExceptionlessClientExtensions {
10-
private static ThreadExceptionEventHandler _onApplicationThreadException;
11-
12-
public static void RegisterApplicationThreadExceptionHandler(this ExceptionlessClient client) {
13-
if (client == null)
14-
throw new ArgumentNullException(nameof(client));
15-
16-
if (_onApplicationThreadException == null)
17-
_onApplicationThreadException = (sender, args) => {
18-
var contextData = new ContextData();
19-
contextData.MarkAsUnhandledError();
20-
contextData.SetSubmissionMethod("ApplicationThreadException");
21-
22-
args.Exception.ToExceptionless(contextData, client).Submit();
23-
};
24-
25-
try {
26-
System.Windows.Forms.Application.ThreadException -= _onApplicationThreadException;
27-
System.Windows.Forms.Application.ThreadException += _onApplicationThreadException;
28-
} catch (Exception ex) {
29-
client.Configuration.Resolver.GetLog().Error(typeof(ExceptionlessClientExtensions), ex, "An error occurred while wiring up to the application thread exception event.");
30-
}
31-
}
32-
33-
public static void UnregisterApplicationThreadExceptionHandler(this ExceptionlessClient client) {
34-
if (client == null)
35-
throw new ArgumentNullException(nameof(client));
36-
37-
if (_onApplicationThreadException == null)
38-
return;
39-
40-
System.Windows.Forms.Application.ThreadException -= _onApplicationThreadException;
41-
_onApplicationThreadException = null;
42-
}
43-
449
private static DispatcherUnhandledExceptionEventHandler _onApplicationDispatcherUnhandledException;
4510

4611
public static void RegisterApplicationDispatcherUnhandledExceptionHandler(this ExceptionlessClient client) {

0 commit comments

Comments
 (0)