cleaned up app startup logic.

fixed update app issue.
This commit is contained in:
kay.one
2013-08-15 19:20:54 -07:00
parent b1e5646d7d
commit a4a58c59f1
16 changed files with 148 additions and 54 deletions
+13
View File
@@ -0,0 +1,13 @@
using System.Windows.Forms;
using NzbDrone.Host;
namespace NzbDrone
{
public class MessageBoxUserAlert : IUserAlert
{
public void Alert(string message)
{
MessageBox.Show(text: message, buttons: MessageBoxButtons.OK, icon: MessageBoxIcon.Warning, caption: "NzbDrone");
}
}
}
+1
View File
@@ -96,6 +96,7 @@
<Compile Include="..\NzbDrone.Common\Properties\SharedAssemblyInfo.cs">
<Link>Properties\SharedAssemblyInfo.cs</Link>
</Compile>
<Compile Include="MessageBoxUserAlert.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
+5 -1
View File
@@ -1,6 +1,7 @@
using System;
using System.Windows.Forms;
using NzbDrone.Common.EnvironmentInfo;
using NzbDrone.Host;
using NzbDrone.SysTray;
namespace NzbDrone
@@ -11,10 +12,13 @@ namespace NzbDrone
{
try
{
var container = Host.Bootstrap.Start(new StartupArguments(args));
var container = Bootstrap.Start(new StartupArguments(args), new MessageBoxUserAlert());
container.Register<ISystemTrayApp, SystemTrayApp>();
container.Resolve<ISystemTrayApp>().Start();
}
catch (TerminateApplicationException)
{
}
catch (Exception e)
{
var message = string.Format("{0}: {1}", e.GetType().Name, e.Message);