コード例 #1
0
        private void add_rune_xml_button_Click(object sender, EventArgs e)
        {
            //string promptValue = Prompt.ShowDialog("Enter Rune Name", "Add New Rune");

            DialogResult promptReturn = EnterNewRuneForm.Show("Enter New Rune", "OK", "CANCEL");

            if (promptReturn == DialogResult.Yes)
            {
                XmlNode root = xmlDoc.DocumentElement;

                //rune name
                XmlElement newElement = xmlDoc.CreateElement("Rune");
                newElement.SetAttribute("name", EnterNewRuneForm.add_rune_name);

                //rune url
                XmlElement newElementUrl = xmlDoc.CreateElement("Url");
                newElementUrl.InnerText = EnterNewRuneForm.add_rune_url;

                //append
                newElement.AppendChild(newElementUrl);

                root.AppendChild(newElement);

                //add to list
                runes_listbox.Items.Add(new Runes_List(EnterNewRuneForm.add_rune_name, EnterNewRuneForm.add_rune_url));

                xmlDoc.Save("runes_list.xml");
            }
        }
コード例 #2
0
 public static DialogResult Show(string Text, string btnOK, string btnCancel)
 {
     MsgBox = new EnterNewRuneForm();
     result = DialogResult.No;
     MsgBox.ShowDialog();
     return(result);
 }