예제 #1
0
        public PluginParentItem(XPathNavigator pluginRootnode)
        {
            if (pluginRootnode == null)
            {
                throw new ArgumentNullException("pluginRootnode");
            }
            this.realName     = XmlHelperClass.GetXmlStringValue(pluginRootnode, "@parent");
            this.matchingName = PluginSearch.GetFirstMatchingNamespaceName(this.realName);
            this.merge        = XmlHelperClass.GetXmlBoolValue(pluginRootnode, "@merge", true);
            string childName = XmlHelperClass.GetXmlStringValue(pluginRootnode, "@child");

            if (!string.IsNullOrEmpty(childName))
            {
                this.children.Add(new PluginChildItem(childName));
            }
            else
            {
                XPathNodeIterator pChild =
                    pluginRootnode.SelectChildren("child", ApplicationHelpers.Help2NamespaceUri);
                while (pChild.MoveNext())
                {
                    this.children.Add(new PluginChildItem(pChild.Current));
                }
            }
        }
        public NamespaceItemClass(XPathNavigator rootNode)
        {
            if (rootNode == null)
            {
                throw new ArgumentNullException("rootNode");
            }

            this.name        = XmlHelperClass.GetXmlStringValue(rootNode, "@name");
            this.description = XmlHelperClass.GetXmlStringValue(rootNode, "@description");
            this.collection  = XmlHelperClass.GetXmlStringValue(rootNode, "@file");
            this.update      = XmlHelperClass.GetXmlBoolValue(rootNode, "@update");
            this.merge       = XmlHelperClass.GetXmlBoolValue(rootNode, "@merge", true);
            this.noremove    = XmlHelperClass.GetXmlBoolValue(rootNode, "@noremove");
            this.connections = PluginSearch.FindPluginAsGenericList(this.name);

            this.Initialize(rootNode);
        }