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));
                }
            }
        }
        private void PatchChildXmlNode(string realParentName, string realChildName, string matchingChildName)
        {
            if (this.xmldoc == null ||
                string.IsNullOrEmpty(realParentName) ||
                string.IsNullOrEmpty(realChildName) ||
                string.IsNullOrEmpty(matchingChildName))
            {
                return;
            }

            XmlNode node = this.xmldoc.SelectSingleNode
                               (string.Format(CultureInfo.InvariantCulture, "/register/plugin[@parent=\"{0}\"]", realParentName));

            if (node != null)
            {
                string childName = XmlHelperClass.GetXmlStringValue(node.CreateNavigator(), "@child");
                if (childName.Length > 0 && String.Compare(childName, realChildName) == 0)
                {
                    XmlHelperClass.SetXmlStringAttributeValue(node.CreateNavigator(), "child", matchingChildName);
                }
                else
                {
                    XmlNode child = node.SelectSingleNode(string.Format(CultureInfo.InvariantCulture, "child[@name=\"{0}\"]", realChildName));
                    XmlHelperClass.SetXmlStringAttributeValue(child.CreateNavigator(), "name", matchingChildName);
                }
                this.xmldoc.Save(this.xmlFilename);
            }
        }
 public PluginChildItem(XPathNavigator pluginRootnode)
 {
     if (pluginRootnode == null)
     {
         throw new ArgumentNullException("pluginRootnode");
     }
     this.realName     = XmlHelperClass.GetXmlStringValue(pluginRootnode, "@name");
     this.matchingName = PluginSearch.GetFirstMatchingNamespaceName(this.realName);
 }
        public FilterItemClass(XPathNavigator rootFilternode)
        {
            if (rootFilternode == null)
            {
                throw new ArgumentNullException("rootFilternode");
            }

            this.name  = XmlHelperClass.GetXmlStringValue(rootFilternode, "@name");
            this.query = rootFilternode.Value;
        }
        private void PatchParentXmlNode(string realParentName, string matchingParentName)
        {
            if (this.xmldoc == null ||
                string.IsNullOrEmpty(realParentName) ||
                string.IsNullOrEmpty(matchingParentName))
            {
                return;
            }

            XmlNode node = this.xmldoc.SelectSingleNode
                               (string.Format(CultureInfo.InvariantCulture, "/register/plugin[@parent=\"{0}\"]", realParentName));

            XmlHelperClass.SetXmlStringAttributeValue(node.CreateNavigator(), "parent", matchingParentName);
            this.xmldoc.Save(this.xmlFilename);
        }
        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);
        }
        void PatchXmlNode(string namespaceName, string pluginName, string matchingName)
        {
            if (this.xmldoc == null ||
                string.IsNullOrEmpty(namespaceName) ||
                string.IsNullOrEmpty(pluginName) ||
                string.IsNullOrEmpty(matchingName))
            {
                return;
            }

            XmlNode node = xmldoc.SelectSingleNode
                               (string.Format(CultureInfo.InvariantCulture,
                                              "/help2:register/help2:namespace[@name=\"{0}\"]/help2:plugin/help2:child[@name=\"{1}\"]",
                                              namespaceName, pluginName), this.xmlns);

            XmlHelperClass.SetXmlStringAttributeValue(node.CreateNavigator(), "name", matchingName);
            xmldoc.Save(this.xmlFilename);
        }
        public DocumentItemClass(XPathNavigator rootFilenode)
        {
            if (rootFilenode == null)
            {
                throw new ArgumentNullException("rootFilenode");
            }

            this.id            = XmlHelperClass.GetXmlStringValue(rootFilenode, "@Id");
            this.hxs           = XmlHelperClass.GetXmlStringValue(rootFilenode, "@HxS");
            this.hxi           = XmlHelperClass.GetXmlStringValue(rootFilenode, "@HxI");
            this.hxq           = XmlHelperClass.GetXmlStringValue(rootFilenode, "@HxQ");
            this.hxr           = XmlHelperClass.GetXmlStringValue(rootFilenode, "@HxR");
            this.languageId    = XmlHelperClass.GetXmlIntValue(rootFilenode, "@LangId", 1033);
            this.hxsMediaId    = XmlHelperClass.GetXmlIntValue(rootFilenode, "@HxSMediaId", 0);
            this.hxqMediaId    = XmlHelperClass.GetXmlIntValue(rootFilenode, "@HxQMediaId", 0);
            this.hxrMediaId    = XmlHelperClass.GetXmlIntValue(rootFilenode, "@HxRMediaId", 0);
            this.sampleMediaId = XmlHelperClass.GetXmlIntValue(rootFilenode, "@SampleMediaId", 0);
        }