public SetEnabled ( string addinId, bool enabled, bool defaultValue, bool exactVersionMatch ) : void | ||
addinId | string | |
enabled | bool | |
defaultValue | bool | |
exactVersionMatch | bool | |
리턴 | void |
public static DatabaseConfiguration Read(string file) { DatabaseConfiguration config = new DatabaseConfiguration (); XmlDocument doc = new XmlDocument (); doc.Load (file); XmlElement disabledElem = (XmlElement) doc.DocumentElement.SelectSingleNode ("DisabledAddins"); if (disabledElem != null) { // For back compatibility foreach (XmlElement elem in disabledElem.SelectNodes ("Addin")) config.SetEnabled (elem.InnerText, false, true); return config; } XmlElement statusElem = (XmlElement) doc.DocumentElement.SelectSingleNode ("AddinStatus"); if (statusElem != null) { foreach (XmlElement elem in statusElem.SelectNodes ("Addin")) { AddinStatus status = new AddinStatus (elem.GetAttribute ("id")); string senabled = elem.GetAttribute ("enabled"); status.Enabled = senabled.Length == 0 || senabled == "True"; status.Uninstalled = elem.GetAttribute ("uninstalled") == "True"; config.addinStatus [status.AddinId] = status; foreach (XmlElement fileElem in elem.SelectNodes ("File")) { if (status.Files == null) status.Files = new List<string> (); status.Files.Add (fileElem.InnerText); } } } return config; }
static DatabaseConfiguration ReadInternal(string file) { DatabaseConfiguration config = new DatabaseConfiguration(); XmlDocument doc = new XmlDocument(); doc.Load(file); XmlElement disabledElem = (XmlElement)doc.DocumentElement.SelectSingleNode("DisabledAddins"); if (disabledElem != null) { // For back compatibility foreach (XmlElement elem in disabledElem.SelectNodes("Addin")) { config.SetEnabled(elem.InnerText, false, true, false); } return(config); } XmlElement statusElem = (XmlElement)doc.DocumentElement.SelectSingleNode("AddinStatus"); if (statusElem != null) { foreach (XmlElement elem in statusElem.SelectNodes("Addin")) { AddinStatus status = new AddinStatus(elem.GetAttribute("id")); string senabled = elem.GetAttribute("enabled"); status.Enabled = senabled.Length == 0 || senabled == "True"; status.Uninstalled = elem.GetAttribute("uninstalled") == "True"; config.addinStatus [status.AddinId] = status; foreach (XmlElement fileElem in elem.SelectNodes("File")) { if (status.Files == null) { status.Files = new List <string> (); } status.Files.Add(fileElem.InnerText); } } } return(config); }