コード例 #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
        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);
        }
コード例 #3
0
        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);
        }