예제 #1
0
        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);
            }
        }
예제 #2
0
 /// <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());
         }
     });
 }
예제 #3
0
        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);
        }