Revision 100379b3 trunk/Pithos.Client.WPF/App.xaml.cs
b/trunk/Pithos.Client.WPF/App.xaml.cs | ||
---|---|---|
55 | 55 |
using log4net.Appender; |
56 | 56 |
using log4net.Core; |
57 | 57 |
using log4net.Repository.Hierarchy; |
58 |
using System.Runtime.InteropServices; |
|
58 | 59 |
|
59 | 60 |
|
60 | 61 |
namespace Pithos.Client.WPF |
... | ... | |
66 | 67 |
{ |
67 | 68 |
private static readonly log4net.ILog Log = log4net.LogManager.GetLogger( MethodBase.GetCurrentMethod().DeclaringType ); |
68 | 69 |
|
69 |
|
|
70 |
///DLL Import to add restart manager support |
|
71 |
[DllImport("kernel32.dll", CharSet = CharSet.Auto)] |
|
72 |
static extern uint RegisterApplicationRestart(string pwzCommandLine, RestartFlags dwFlags); |
|
73 |
|
|
70 | 74 |
public App() |
71 | 75 |
{ |
72 | 76 |
|
... | ... | |
74 | 78 |
|
75 | 79 |
InitializeLogging(); |
76 | 80 |
|
81 |
///Register Application in the Restartmanager service |
|
82 |
RegisterApplicationRestart("Upgrade", RestartFlags.NONE); |
|
83 |
|
|
77 | 84 |
|
78 | 85 |
DispatcherUnhandledException += OnDispatcherUnhandledException; |
79 | 86 |
AppDomain.CurrentDomain.UnhandledException += OnUnhandledException; |
... | ... | |
292 | 299 |
} |
293 | 300 |
|
294 | 301 |
} |
302 |
|
|
303 |
enum RestartFlags |
|
304 |
{ |
|
305 |
NONE = 0, |
|
306 |
RESTART_CYCLICAL = 1, |
|
307 |
RESTART_NOTIFY_SOLUTION = 2, |
|
308 |
RESTART_NOTIFY_FAULT = 4, |
|
309 |
RESTART_NO_CRASH = 8, |
|
310 |
RESTART_NO_HANG = 16, |
|
311 |
RESTART_NO_PATCH = 32, |
|
312 |
RESTART_NO_REBOOT = 64 |
|
313 |
} |
Also available in: Unified diff