Exemple #1
0
        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);
            }
        }
Exemple #2
0
        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);
                }
            }
        }
        private void ChangeEditor()
        {
            if (InputValid())
            {
                if (NameChanged() || InputChanged())
                {
                    TrimInput();

                    if (ApplicationExists())
                    {
                        if (EditorCollection.GetByName(textBoxName.Text) != null && NameChanged())
                        {
                            MessageBox.Show("An editor with this name already exists.", "Duplicate Name Conflict", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        }
                        else
                        {
                            EditorCollection.Get(EditorObject).Application = textBoxApplication.Text;
                            EditorCollection.Get(EditorObject).Arguments   = textBoxArguments.Text;
                            EditorCollection.Get(EditorObject).Name        = textBoxName.Text;
                            EditorCollection.Get(EditorObject).Notes       = textBoxNotes.Text;

                            Okay();
                        }
                    }
                    else
                    {
                        MessageBox.Show($"Could not find \"{textBoxApplication.Text}\".", "Application Not Found", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                else
                {
                    Close();
                }
            }
            else
            {
                MessageBox.Show("Please enter valid input for each field.", "Invalid Input", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemple #4
0
        private void ChangeEditor()
        {
            if (InputChanged())
            {
                TrimInput();

                if (EditorCollection.GetByName(textBoxEditorName.Text) == null)
                {
                    EditorCollection.Get(EditorObject).Application = textBoxEditorApplication.Text;
                    EditorCollection.Get(EditorObject).Arguments   = textBoxEditorArguments.Text;
                    EditorCollection.Get(EditorObject).Name        = textBoxEditorName.Text;

                    Okay();
                }
                else
                {
                    MessageBox.Show("An editor with this name already exists.", "Duplicate Name Conflict", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            else
            {
                Close();
            }
        }