SaveAsXml() private méthode

Saves this assembly list to XML.
private SaveAsXml ( ) : XElement
Résultat XElement
Exemple #1
0
 /// <summary>
 /// Saves the specifies assembly list into the config file.
 /// </summary>
 public static void SaveList(AssemblyList list)
 {
     if (!list.CanSave)
     {
         return;
     }
     ILSpySettings.Update(
         delegate(XElement root) {
         XElement doc = root.Element("AssemblyLists");
         if (doc == null)
         {
             doc = new XElement("AssemblyLists");
             root.Add(doc);
         }
         XElement listElement = doc.Elements("List").FirstOrDefault(e => SessionSettings.Unescape((string)e.Attribute("name")) == list.ListName);
         if (listElement != null)
         {
             listElement.ReplaceWith(list.SaveAsXml());
         }
         else
         {
             doc.Add(list.SaveAsXml());
         }
     });
 }
 /// <summary>
 /// Saves the specifies assembly list into the config file.
 /// </summary>
 public static void SaveList(AssemblyList list)
 {
     ILSpySettings.Update(
         delegate (XElement root) {
             XElement doc = root.Element("AssemblyLists");
             if (doc == null) {
                 doc = new XElement("AssemblyLists");
                 root.Add(doc);
             }
             XElement listElement = doc.Elements("List").FirstOrDefault(e => (string)e.Attribute("name") == list.ListName);
             if (listElement != null)
                 listElement.ReplaceWith(list.SaveAsXml());
             else
                 doc.Add(list.SaveAsXml());
         });
 }