mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-19 21:44:30 -04:00
cleaned up app startup logic.
fixed update app issue.
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user