private void editEffectToolStripMenuItem_Click(object sender, EventArgs e) { if (Document.ContainsEffect(effectNameBox.Text)) { EffectDialog ed = new EffectDialog(effectNameBox.Text); ed.Show(); } }
//Effects private void effectNameBox_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Return) { if (!Document.ContainsEffect(effectNameBox.Text)) { if (Document.SetEffect(effectNameBox.Text, null)) { EffectDialog ed = new EffectDialog(effectNameBox.Text); ed.Show(); } } e.SuppressKeyPress = true; } }
private void newEffectToolStripMenuItem_Click(object sender, EventArgs e) { if (!Document.ContainsEffect(effectNameBox.Text)) { if (Document.SetEffect(effectNameBox.Text, null)) { EffectDialog ed = new EffectDialog(effectNameBox.Text, this); ed.Show(); } else { MessageBox.Show("Please enter a valid name for your effect in the box above.", "Naming Error"); } } else { MessageBox.Show(string.Format("An effect named {0} already exists. Type a new name in the box above, or remove the existing effect.", effectNameBox.Text), "Naming Conflict"); } }