using log4net.Appender;
using log4net.Core;
using log4net.Repository.Hierarchy;
+using System.Runtime.InteropServices;
namespace Pithos.Client.WPF
{
private static readonly log4net.ILog Log = log4net.LogManager.GetLogger( MethodBase.GetCurrentMethod().DeclaringType );
-
+ ///DLL Import to add restart manager support
+ [DllImport("kernel32.dll", CharSet = CharSet.Auto)]
+ static extern uint RegisterApplicationRestart(string pwzCommandLine, RestartFlags dwFlags);
+
public App()
{
InitializeLogging();
+ ///Register Application in the Restartmanager service
+ RegisterApplicationRestart("Upgrade", RestartFlags.NONE);
+
DispatcherUnhandledException += OnDispatcherUnhandledException;
AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;
}
}
+
+ enum RestartFlags
+ {
+ NONE = 0,
+ RESTART_CYCLICAL = 1,
+ RESTART_NOTIFY_SOLUTION = 2,
+ RESTART_NOTIFY_FAULT = 4,
+ RESTART_NO_CRASH = 8,
+ RESTART_NO_HANG = 16,
+ RESTART_NO_PATCH = 32,
+ RESTART_NO_REBOOT = 64
+ }
\ No newline at end of file
public class AppBootstrapper : Bootstrapper<IShell>
{
+
CompositionContainer container;
public AppBootstrapper()
{
LogManager.GetLog = type => new log4netLogger(type);
UpgradeSettings();
-
}
private void UpgradeSettings()
container.SatisfyImportsOnce(instance);
}
}
-}
+}
\ No newline at end of file
using System.Windows.Interop;
using IWin32Window = System.Windows.Forms.IWin32Window;
-
namespace Pithos.Client.WPF
{
public class Wpf32Window : IWin32Window
#endregion
using System.ServiceModel;
using Pithos.ShellExtensions.PithosService;
+using System.Runtime.InteropServices;
namespace Pithos.ShellExtensions
{
/// </summary>
public static class PithosHost
{
+
/// <summary>
/// Provides a client for retrieving file status from the Pithos App
/// </summary>
}
}
+
+enum RestartFlags
+{
+ NONE = 0,
+ RESTART_CYCLICAL = 1,
+ RESTART_NOTIFY_SOLUTION = 2,
+ RESTART_NOTIFY_FAULT = 4,
+ RESTART_NO_CRASH = 8,
+ RESTART_NO_HANG = 16,
+ RESTART_NO_PATCH = 32,
+ RESTART_NO_REBOOT = 64
+}
\ No newline at end of file