Пример #1
0
 private void SaveSettings(XmlElement xml, SettingsPageCollection diffBase)
 {
     foreach (var page in m_settings.Values)
     {
         var pageBase = diffBase.m_settings[page.Attribute.Name];
         foreach (PropertyInfo prop in pageBase.SettingsPage.GetType().GetProperties())
         {
             foreach (SettingsKeyAttribute attr in prop.GetCustomAttributes(typeof(SettingsKeyAttribute), true))
             {
                 object myvalue = prop.CallGet(page.SettingsPage), baseValue = prop.CallGet(pageBase.SettingsPage);
                 if (myvalue != null && !myvalue.Equals(baseValue))
                 {
                     XmlElement parx = xml.AddChild("Param");
                     parx.SetAttribute("name", attr.KeyName);
                     parx.SetAttribute("value", XmlTool.PropertyToString(prop, myvalue));
                 }
             }
         }
     }
 }