示例#1
0
 public void Add(UISetting uiSetting)
 {
     using (XmlWriter writer = XmlWriter.Create("UISettings.xml"))
     {
         writer.WriteStartDocument();
         writer.WriteStartElement("Settings");
         writer.WriteStartElement("Skin");
         writer.WriteElementString("Name", uiSetting.SkinName);
         writer.WriteEndElement();
         writer.WriteEndElement();
         writer.WriteEndDocument();
     }
 }
示例#2
0
        public UISetting GetUISetting()
        {
            UISetting uiSetting = new UISetting();

            XmlDocument xmlDoc = new XmlDocument();

            xmlDoc.Load("UISettings.xml");

            //sender info
            XmlNodeList senderNodeList = xmlDoc.DocumentElement.SelectNodes("Skin");

            uiSetting.SkinName = senderNodeList[0].SelectSingleNode("Name").InnerText;

            return(uiSetting);
        }