Esempio n. 1
0
        /// <summary>
        /// 加载插件信息
        /// </summary>
        public void Load()
        {
            List <PluginGroupInfo> groups = new List <PluginGroupInfo>();
            XmlHelper   xml        = new XmlHelper(FileName);
            XmlNodeList groupNodes = xml.Root.SelectNodes("pluginGroup");

            foreach (XmlNode groupNode in groupNodes)
            {
                //读取插件分组
                PluginGroupInfo groupInfo = new PluginGroupInfo()
                {
                    GroupCode = groupNode.Attributes["groupCode"].Value,
                    GroupText = groupNode.Attributes["groupText"].Value,
                    GroupName = groupNode.Attributes["groupName"].Value,
                    GroupUrl  = groupNode.Attributes["groupUrl"].Value
                };
                //读取插件信息
                XmlNodeList nodes = groupNode.ChildNodes;
                if (nodes != null)
                {
                    foreach (XmlNode node in nodes)
                    {
                        if (node.Name == "plugin")
                        {
                            PluginInfo info = new PluginInfo()
                            {
                                Code  = node.Attributes["code"].Value,
                                Text  = node.Attributes["text"].Value,
                                Name  = node.Attributes["name"].Value,
                                Url   = node.Attributes["url"].Value,
                                Group = groupInfo
                            };
                            groupInfo.Plugins.Add(info);
                        }
                    }
                }
                groups.Add(groupInfo);
            }
            Plugins = groups;
        }
Esempio n. 2
0
 public PluginInfo()
 {
     Group = new PluginGroupInfo();
 }