public FormSettings() { InitializeComponent(); Icon = Resources.preferencesIcon; if (!SystemInformation.IsRunningOnMono()) { startUpUtilities = new StartupUtilities(StartupUtilities.StartupUserScope.CurrentUser); checkAutoStart.Checked = startUpUtilities.CheckIfRunAtWinBoot(APP_KEY_NAME); } else { checkAutoStart.Visible = false; } }
private void StartPipeNotification() { #if DEBUG log.Info("Debug mode / Skipping one-instance-only stuff"); #else if (SystemInformation.IsRunningOnMono()) { // XXX Mono sometimes stack overflows for whatever reason. return; } new Thread(() => { for (;;) { try { using (var pipe = new NamedPipeServerStream( "simpledlnagui", PipeDirection.InOut)) { pipe.WaitForConnection(); pipe.ReadByte(); BeginInvoke((Action)(() => { notifyIcon_DoubleClick(null, null); BringToFront(); })); } } catch (Exception) { // ignored } } // ReSharper disable once FunctionNeverReturns }) { IsBackground = true }.Start(); #endif }