private void btnOK_Click(object sender, EventArgs e) { if (!NamingMacro.CheckRule(textEditor.RichTextBox.Text)) { Messages.ShowWarningOk(this, Resources.NamingRuleEditorWarning); textEditor.Focus(); return; } TargetRule = checkDisable.Checked ? String.Empty : NamingMacro.ParseRuleFromText(textEditor.RichTextBox.Text); DialogResult = DialogResult.OK; }