private void AddNewEditor() { if (InputValid()) { TrimInput(); if (ApplicationExists()) { if (EditorCollection.GetByName(textBoxEditorName.Text) == null) { EditorCollection.Add(new Editor(textBoxEditorName.Text, textBoxEditorApplication.Text, textBoxEditorArguments.Text)); Okay(); } else { MessageBox.Show("An editor with this name already exists.", "Duplicate Name Conflict", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } else { MessageBox.Show($"Could not find \"{textBoxEditorApplication.Text}\".", "Application Not Found", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { MessageBox.Show("Please enter valid input for each field.", "Invalid Input", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void AddNewEditor() { if (InputValid()) { TrimInput(); if (EditorCollection.GetByName(textBoxEditorName.Text) == null) { EditorCollection.Add(new Editor(textBoxEditorName.Text, textBoxEditorApplication.Text, textBoxEditorArguments.Text)); Okay(); } else { MessageBox.Show("An editor with this name already exists.", "Duplicate Name Conflict", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } }