コード例 #1
0
        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);
            }
        }
コード例 #2
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));
                }
            }
        }
コード例 #3
0
 public PluginChildItem(XPathNavigator pluginRootnode)
 {
     if (pluginRootnode == null)
     {
         throw new ArgumentNullException("pluginRootnode");
     }
     this.realName     = XmlHelperClass.GetXmlStringValue(pluginRootnode, "@name");
     this.matchingName = PluginSearch.GetFirstMatchingNamespaceName(this.realName);
 }
コード例 #4
0
        public FilterItemClass(XPathNavigator rootFilternode)
        {
            if (rootFilternode == null)
            {
                throw new ArgumentNullException("rootFilternode");
            }

            this.name  = XmlHelperClass.GetXmlStringValue(rootFilternode, "@name");
            this.query = rootFilternode.Value;
        }
コード例 #5
0
        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);
        }
コード例 #6
0
        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);
        }