WIP
Logger and exceptionManager
This commit is contained in:
+22
-25
@@ -8,8 +8,9 @@ using System.Threading;
|
||||
using System.Web;
|
||||
using TeamDev.SDK;
|
||||
using TeamDev.SDK.MVVM;
|
||||
using static Step.Config.StartupConfig;
|
||||
using Step.Config;
|
||||
using static Step.Config.StartupConfig;
|
||||
using static Step.Utils.StepLogger;
|
||||
|
||||
namespace Step
|
||||
{
|
||||
@@ -22,34 +23,30 @@ namespace Step
|
||||
|
||||
public static void Main()
|
||||
{
|
||||
try
|
||||
Info("Application started");
|
||||
StartupConfigController.ReadStartupConfig();
|
||||
|
||||
// Start self host application
|
||||
string configuredUri = "http://localhost:" + ServerConfig.ServerPort.ToString();
|
||||
|
||||
// Start WinForm
|
||||
ServerControlWindow.Start();
|
||||
|
||||
// Register listener to "close application" messages
|
||||
MessageServices.Current.Subscribe("StopServer", (a, b) =>
|
||||
{
|
||||
StartupConfigController.ReadStartupConfig();
|
||||
StopRequest.Set();
|
||||
});
|
||||
|
||||
// Start self host application
|
||||
string configuredUri = "http://localhost:" + serverConfig.ServerPort.ToString();
|
||||
|
||||
// Start WinForm
|
||||
ServerControlWindow.Start();
|
||||
|
||||
// Register listener to "close application" messages
|
||||
MessageServices.Current.Subscribe("StopServer", (a, b) =>
|
||||
{
|
||||
StopRequest.Set();
|
||||
});
|
||||
|
||||
// Start server services
|
||||
using (WebApp.Start<Step.App_Start.Startup>(url: configuredUri))
|
||||
{
|
||||
StopRequest.WaitOne();
|
||||
}
|
||||
// Close WinForm
|
||||
ServerControlWindow.Stop();
|
||||
}
|
||||
catch (Exception ex)
|
||||
// Start server services
|
||||
using (WebApp.Start<Step.App_Start.Startup>(url: configuredUri))
|
||||
{
|
||||
Console.WriteLine(ex);
|
||||
StopRequest.WaitOne();
|
||||
Info("Application closed");
|
||||
}
|
||||
|
||||
// Close WinForm
|
||||
ServerControlWindow.Stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user