-
Notifications
You must be signed in to change notification settings - Fork 1
/
App.xaml.cs
33 lines (29 loc) · 1.07 KB
/
App.xaml.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using Microsoft.Xrm.Tooling.Connector;
using System;
using System.Diagnostics;
using System.Net;
using System.Windows;
using System.Windows.Threading;
namespace WebResourceManager
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
public App()
{
ServicePointManager.DefaultConnectionLimit = 5;
ServicePointManager.UseNagleAlgorithm = false;
ServicePointManager.Expect100Continue = false;
ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12;
Dispatcher.UnhandledException += OnDispatcherUnhandledException;
}
private void OnDispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
{
var errorMessage = $"An unhandled exception occurred: {e.Exception.Message}\r\n\r\n{e.Exception.ToString()}";
MessageBox.Show(errorMessage, "Web Resource Manager - Error", MessageBoxButton.OK, MessageBoxImage.Error);
e.Handled = true;
}
}
}