private void ManuallyShownTabs_AddClickMenu(object sender, EventArgs e)
 {
     _viewUserSettings.Enabled = false;
     _dialog.SetText("Please enter the name of the new template to be added:");
     _dialog.Tag = ToString();
     _dialog.Show();
     _selectedMenu = "Add";
 }
 private void ViewRules_ClickRenameButton(object sender, EventArgs e)
 {
     _selectedRuleIndex = _view.RuleNames.SelectedIndex;
     _dialog.SetText("Please enter the new name:");
     _dialog.Tag = ToString();
     _dialog.Show();
     _selectedContextMenu = "Rename";
     _view.Group2RegEx.Hide();
     _view.FlowLayoutPanelRegExHelp.Hide();
     _view.Group3Items.Hide();
     _view.Group4Help.Hide();
     _viewUserSettings.Enabled = false;
 }
        private void ShowWarningDialog(string fileNameWithExtension, FileMethod fileMethod)
        {
            _fileMethod = fileMethod;
            switch (fileMethod)
            {
            case FileMethod.Add:
                _dialog.SetText("Do you want to add " + fileNameWithExtension + "?");
                break;

            case FileMethod.Delete:
                _dialog.SetText("Do you want to delete " + fileNameWithExtension + "? This can't be cancelled!");
                break;

            case FileMethod.Replace:
                _dialog.SetText("Do you want to replace " + fileNameWithExtension + "? This can't be cancelled!");
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(fileMethod), fileMethod, null);
            }

            _dialog.Tag = ToString();
            _dialog.UserInput.Hide();
            _dialog.Show();
        }
 private void ResetToFactorySettings_Click1(object sender, EventArgs e)
 {
     _dialog.Tag = "ResetToFactorySettingsClocked";
     _dialog.UserInput.Hide();
     _dialog.SetText("Do you want to reset to Factory settings?" +
                     " The program will be restarted.");
     _dialog.Show();
 }
        private void DataFilesUserHasAdded()
        {
            var index = 0;

            foreach (var settingsFile in _settings.AdvancedFiles)
            {
                if (!File.Exists(settingsFile))
                {
                    var r = Screen.PrimaryScreen.Bounds;
                    _dialog.Location = new Point(r.Right / 2, r.Bottom / 2);
                    _dialog.BringToFront();
                    _dialog.SetText(AddFileToInfoText(settingsFile));
                    _dialog.UserInput.Hide();
                    _settings.AdvancedFiles.RemoveAt(index);
                    DataFilesUserHasAdded(); // can't continue iterating foreach when item removed.
                    _dialog.Show();
                    _settings.Save();
                    return;
                }
                index++;
            }
        }