static void Main() { Application.SetHighDpiMode(HighDpiMode.SystemAware); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Microsoft.ApplicationInsights.TelemetryClient tc = new TelemetryClient(TelemetryConfiguration.CreateDefault()); tc.InstrumentationKey = "0270dc4e-ba5a-48e2-9f1d-aac8a1b632c3"; //TimeMarkerConfiguration = SkyhoshiApplicationConfigurationBuilder.CreateLoadSettingsFromDefaultLocations(); TimeMarkerConfiguration.Load(); KeyBindingHook = new KeyboardHook(); frmSettingsMain mainForm = new frmSettingsMain(); KeyBindingHook.RegisterHotKey(ModifierKeys.Control, Keys.K); KeyBindingHook.KeyPressed += (sender, args) => { if (TimeMarkerConfiguration.BringAnyOpenWindowToFrontOnShortcutKeyPressed) { mainForm.Activate(); mainForm.Focus(); mainForm.BringToFront(); } if (TimeMarkerConfiguration.AllowAnyMessageBoxOnShortcutKeyPressed) { Skyhoshi.Windows.Forms.Diagnostics.DebugMessageBox(mainForm); } System.Diagnostics.Debug.WriteLine($"Shortcut Key's pressed"); }; Application.Run(mainForm); Application.Idle += (sender, args) => { //backup database }; //Application.Run(new frmSettingsMain()); //Application.Run(new frmSettingsMain()); //Application.Run(new frmSettingsMain()); Application.ApplicationExit += Application_ApplicationExit; }
public static void SaveConfiguration() { TimeMarkerConfiguration.Save(); }