using System; using System.ServiceProcess; using FilterAPI; using FilterLauncher.LauncherNetworking; using FilterLauncher.LocalHandlers; using FilterLauncher.LocalNetworking; namespace FilterLauncher { public partial class Service : ServiceBase { public Service() { } public void Init() { Program.Conf = new Config(); Program.SQL = new Database(Program.Conf); Program.LocalHandlers = new LocalHandlerLoader(); Program.LocalClient = new LocalClient(); AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; Program.LRest = new LauncherRest(); } protected override void OnStart(string[] args) { Init(); } protected override void OnStop() { Program.LRest.Stop(); } private void CurrentDomain_UnhandledException(Object Sender, UnhandledExceptionEventArgs Args) { Program.SendConsoleText(ConsoleColor.Red, ((Exception)Args.ExceptionObject).ToString()); } } }