public void ShowAssemblyList(string name) { ILSpySettings settings = this.spySettings; if (settings == null) { settings = ILSpySettings.Load(); } AssemblyList list = this.assemblyListManager.LoadList(settings, name); //Only load a new list when it is a different one if (list.ListName != CurrentAssemblyList.ListName) { ShowAssemblyList(list); } }
/// <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()); } }); }
public bool DeleteList(string Name) { if (AssemblyLists.Contains(Name)) { AssemblyLists.Remove(Name); ILSpySettings.Update( delegate(XElement root) { XElement doc = root.Element("AssemblyLists"); if (doc == null) { return; } XElement listElement = doc.Elements("List").FirstOrDefault(e => (string)e.Attribute("name") == Name); if (listElement != null) { listElement.Remove(); } }); return(true); } return(false); }