public static List <PluginClass> GetAllPlugin() { if (xmlDoc == null) { InitConfig(); } List <PluginClass> plist = new List <PluginClass>(); XmlNodeList nl = null; nl = xmlDoc.DocumentElement.SelectNodes("WebModulePlugin/Plugin"); foreach (XmlNode n in nl) { PluginClass plugin = new PluginClass(); plugin.plugintype = "WebModulePlugin"; plugin.name = n.Attributes["name"].Value; plugin.title = n.Attributes["title"].Value; plugin.path = n.Attributes["path"].Value; plugin.isdevelopment = n.Attributes["isdevelopment"].Value; plist.Add(plugin); } nl = xmlDoc.DocumentElement.SelectNodes("WinformModulePlugin/Plugin"); foreach (XmlNode n in nl) { PluginClass plugin = new PluginClass(); plugin.plugintype = "WinformModulePlugin"; plugin.name = n.Attributes["name"].Value; plugin.title = n.Attributes["title"].Value; plugin.path = n.Attributes["path"].Value; plugin.isdevelopment = n.Attributes["isdevelopment"].Value; plist.Add(plugin); } nl = xmlDoc.DocumentElement.SelectNodes("WcfModulePlugin/Plugin"); foreach (XmlNode n in nl) { PluginClass plugin = new PluginClass(); plugin.plugintype = "WcfModulePlugin"; plugin.name = n.Attributes["name"].Value; plugin.title = n.Attributes["title"].Value; plugin.path = n.Attributes["path"].Value; plugin.isdevelopment = n.Attributes["isdevelopment"].Value; plist.Add(plugin); } return(plist); }
public static PluginClass GetPlugin(string pluginType, string name) { if (xmlDoc == null) { InitConfig(); } XmlNodeList nl = xmlDoc.DocumentElement.SelectSingleNode(pluginType).SelectNodes("Plugin"); foreach (XmlNode n in nl) { if (n.Attributes["name"].Value == name) { PluginClass plugin = new PluginClass(); plugin.plugintype = pluginType; plugin.name = n.Attributes["name"].Value; plugin.title = n.Attributes["title"].Value; plugin.path = n.Attributes["path"].Value; plugin.isdevelopment = n.Attributes["isdevelopment"].Value; return(plugin); } } return(null); }