public void WriteXML(XmlTextWriter writer)
 {
     writer.WriteAttributeString(TemplateNameParm, TemplateName);
     writer.WriteAttributeString(AutoStubParm, AutoStub.ToString());
     writer.WriteAttributeString(StubClassParm, StubClass.ToString());
     writer.WriteAttributeString(TemplateAlternateNamesYNParm, HasAlternateNames.ToString());
     writer.WriteAttributeString(TemplateAlternateNamesParm, AlternateNames);
     writer.WriteAttributeString(TemplateImportanceParm, ImportanceSetting.ToString());
     writer.WriteAttributeString(TemplateAutoStubYNParm, AutoStubYN.ToString());
     writer.WriteAttributeString(conSkipRegexYN, SkipRegexYN.ToString());
     writer.WriteAttributeString(conSkipRegex, SkipRegex);
 }
        private void PropertiesButtonClick(object sender, EventArgs e)
        {
            using (GenericTemplatePropertiesForm frm = new GenericTemplatePropertiesForm())
            {
                frm.AmIReadyLabel.Text = AmReady
                    ? "Generic Template Plugin is ready"
                    : "Generic Template Plugin is not properly configured";

                GenericTemplatePropertiesForm.DoRegexTextBox(frm.MainRegexTextBox, MainRegex);
                GenericTemplatePropertiesForm.DoRegexTextBox(frm.PreferredTemplateNameRegexTextBox,
                                                             PreferredTemplateNameRegex);
                GenericTemplatePropertiesForm.DoRegexTextBox(frm.SecondChanceRegexTextBox, SecondChanceRegex);
                GenericTemplatePropertiesForm.DoRegexTextBox(frm.SkipRegexTextBox, SkipRegex);

                frm.HasAltNamesLabel.Text += HasAlternateNames.ToString();

                frm.NameLabel.Text += _ourSettingsControl.TemplateName;

                if (_ourSettingsControl.SkipRegexYN)
                {
                    if (string.IsNullOrEmpty(_ourSettingsControl.SkipRegex))
                    {
                        frm.SkipLabel.Text += bool.FalseString;
                    }
                    else
                    {
                        frm.SkipLabel.Text += bool.TrueString;
                    }
                }
                else
                {
                    frm.SkipLabel.Text += bool.FalseString;
                }

                switch (_ourSettingsControl.ImportanceSetting)
                {
                case GenericTemplateSettings.ImportanceSettingEnum.Imp:
                    frm.ImportanceLabel.Text += "importance=";
                    break;

                case GenericTemplateSettings.ImportanceSettingEnum.None:
                    frm.ImportanceLabel.Text += "<none>";
                    break;

                case GenericTemplateSettings.ImportanceSettingEnum.Pri:
                    frm.ImportanceLabel.Text += "priority=";
                    break;
                }

                if (_ourSettingsControl.AutoStubYN)
                {
                    frm.AutoStubLabel.Text += "auto=yes";
                }
                else
                {
                    frm.AutoStubLabel.Text += "<none>";
                }

                frm.ShowDialog();
            }
        }