Пример #1
0
        private Uri GetAndValidateUrls(string elementName, CultureInfo culture)
        {
            Uri     result  = null;
            XmlNode xmlNode = this.xmlDoc.SelectSingleNode(this.GetOweXpath(elementName), this.namespaceManager);

            if (xmlNode != null)
            {
                string attributeStringValue = ExtensionData.GetAttributeStringValue(xmlNode, "DefaultValue");
                result = SchemaParser.ValidateUrl(this.extensionInstallScope, elementName, attributeStringValue);
                using (XmlNodeList xmlNodeList = xmlNode.SelectNodes(this.GetOweChildPath("Override"), this.namespaceManager))
                {
                    string name = elementName + " " + "Override";
                    foreach (object obj in xmlNodeList)
                    {
                        XmlNode xmlNode2 = (XmlNode)obj;
                        string  attributeStringValue2 = ExtensionData.GetAttributeStringValue(xmlNode2, "Value");
                        Uri     uri = SchemaParser.ValidateUrl(this.extensionInstallScope, name, attributeStringValue2);
                        string  attributeStringValue3 = ExtensionData.GetAttributeStringValue(xmlNode2, "Locale");
                        if (string.Compare(culture.ToString(), attributeStringValue3, StringComparison.OrdinalIgnoreCase) == 0)
                        {
                            result = uri;
                        }
                    }
                }
            }
            return(result);
        }
Пример #2
0
 private void ValidateSourceLocationUrls(string xpath, string urlAttributeName, string errorMessageName)
 {
     using (XmlNodeList xmlNodeList = this.xmlDoc.SelectNodes(xpath, this.namespaceManager))
     {
         foreach (object obj in xmlNodeList)
         {
             XmlNode xmlNode = (XmlNode)obj;
             string  attributeStringValue = ExtensionData.GetAttributeStringValue(xmlNode, urlAttributeName);
             SchemaParser.ValidateUrl(this.extensionInstallScope, errorMessageName, attributeStringValue);
         }
     }
 }