internal XElement SaveAsXml() { return new XElement( "List", new XAttribute("name", this.ListName), assemblies.Where(asm => !asm.IsAutoLoaded).Select(asm => new XElement("Assembly", asm.FileName)) ); }
/// <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()); } }); }