protected override void Configure() { // Sleep for a while if ran from autorun to allow full system boot if (Environment.GetCommandLineArgs().Contains("--autorun")) { var logger = LogManager.GetCurrentClassLogger(); logger.Info("Artemis was run using the autorun shortcut, sleeping for 15 sec."); Thread.Sleep(15000); } _kernel = new StandardKernel(new BaseModules(), new ManagerModules()); _kernel.Bind <IWindowManager>().To <WindowManager>().InSingletonScope(); _kernel.Bind <IEventAggregator>().To <EventAggregator>().InSingletonScope(); // Configure JSON.NET var settings = new JsonSerializerSettings { TypeNameHandling = TypeNameHandling.Auto, ContractResolver = _kernel.Get <NinjectContractResolver>() }; JsonConvert.DefaultSettings = () => settings; //TODO DarthAffe 17.12.2016: Is this the right location for this? //TODO Move to Mainmanager and make disposable ActiveWindowHelper.SetActiveWindowDetectionType(SettingsProvider.Load <GeneralSettings>().ActiveWindowDetection); }
public void Save() { SettingsProvider.Save(this); Logging.SetupLogging(LogLevel); ActiveWindowHelper.SetActiveWindowDetectionType(ActiveWindowDetection); ApplyAutorun(); ApplyTheme(); ApplyGamestatePort(); ApplyScreenCaptureFPS(); }
protected override void Configure() { _kernel = new StandardKernel(new BaseModules(), new ManagerModules()); _kernel.Bind <IWindowManager>().To <WindowManager>().InSingletonScope(); _kernel.Bind <IEventAggregator>().To <EventAggregator>().InSingletonScope(); // Configure JSON.NET var settings = new JsonSerializerSettings { TypeNameHandling = TypeNameHandling.Auto, ContractResolver = _kernel.Get <NinjectContractResolver>() }; JsonConvert.DefaultSettings = () => settings; //TODO DarthAffe 17.12.2016: Is this the right location for this? //TODO Move to Mainmanager and make disposable ActiveWindowHelper.SetActiveWindowDetectionType(SettingsProvider.Load <GeneralSettings>().ActiveWindowDetection); }
protected override void OnExit(object sender, EventArgs e) { _kernel.Dispose(); ActiveWindowHelper.Dispose(); base.OnExit(sender, e); }