private void CheckRegistryKeyExists() { if (string.IsNullOrEmpty(_loadedSettings.MonitoredRegistryKey.Root)) { var newUserMessage = MessageBox.Show(Constants.RegistryKeyMessages.SelectRegistryKeyToMonitor, Constants.RegistryKeyMessages.SelectRegistryKeyToMonitorCaption, MessageBoxButtons.OKCancel, MessageBoxIcon.Information); if (newUserMessage == DialogResult.OK) { var addRegistry = new AddRegistryKey(_loadedSettings); addRegistry.FormClosing += RegistryKeyAdded_EventHandler; addRegistry.Show(); } else { if (_allowLogging) { ExceptionlessClient.Default.SubmitLog(Constants.LogMessages.NoRegistryKey, LogLevel.Info); } Environment.Exit(Constants.EnvironmentExitCodes.NoRegistryKey); } } else { LoadRegistryMonitor(); } }
private void CheckRegistryKeyExists() { if (string.IsNullOrEmpty(_loadedSettings.MonitoredRegistryKey.Root)) { var newUserMessage = MessageBox.Show(Constants.RegistryKeyMessages.SelectRegistryKeyToMonitor, Constants.RegistryKeyMessages.SelectRegistryKeyToMonitorCaption, MessageBoxButtons.OKCancel, MessageBoxIcon.Information); if (newUserMessage == DialogResult.OK) { var addRegistry = new AddRegistryKey(_loadedSettings); addRegistry.FormClosing += RegistryKeyAdded_EventHandler; addRegistry.Show(); } else { if (_allowLogging) ExceptionlessClient.Default.SubmitLog(Constants.LogMessages.NoRegistryKey, LogLevel.Info); Environment.Exit(Constants.EnvironmentExitCodes.NoRegistryKey); } } else LoadRegistryMonitor(); }