Ejemplo n.º 1
0
        private bool ReadAddSchemeSetting()
        {
            string schemeValue = reader.GetAttribute(CommonConfigurationStrings.SchemeName);
            string genericUriParserOptionsValue = reader.GetAttribute(
                CommonConfigurationStrings.GenericUriParserOptions);

            if (string.IsNullOrEmpty(schemeValue) || string.IsNullOrEmpty(genericUriParserOptionsValue))
            {
                return(false);
            }

            try
            {
                GenericUriParserOptions genericUriParserOptions = (GenericUriParserOptions)Enum.Parse(
                    typeof(GenericUriParserOptions), genericUriParserOptionsValue);

                SchemeSettingInternal schemeSetting = new SchemeSettingInternal(schemeValue,
                                                                                genericUriParserOptions);

                sectionData.SchemeSettings[schemeSetting.Name] = schemeSetting;
                return(true);
            }
            catch (ArgumentException)
            {
                return(false);
            }
        }
 private UriSectionInternal(UriSection section) : this()
 {
     this.idnScope = section.Idn.Enabled;
     this.iriParsing = section.IriParsing.Enabled;
     if (section.SchemeSettings != null)
     {
         foreach (SchemeSettingElement element in section.SchemeSettings)
         {
             SchemeSettingInternal internal2 = new SchemeSettingInternal(element.Name, element.GenericUriParserOptions);
             this.schemeSettings.Add(internal2.Name, internal2);
         }
     }
 }
 private UriSectionInternal(UriSection section) : this()
 {
     this.idnScope   = section.Idn.Enabled;
     this.iriParsing = section.IriParsing.Enabled;
     if (section.SchemeSettings != null)
     {
         foreach (SchemeSettingElement element in section.SchemeSettings)
         {
             SchemeSettingInternal internal2 = new SchemeSettingInternal(element.Name, element.GenericUriParserOptions);
             this.schemeSettings.Add(internal2.Name, internal2);
         }
     }
 }
        private bool ReadAddSchemeSetting()
        {
            string attribute = this.reader.GetAttribute("name");
            string str2      = this.reader.GetAttribute("genericUriParserOptions");

            if (string.IsNullOrEmpty(attribute) || string.IsNullOrEmpty(str2))
            {
                return(false);
            }
            try
            {
                GenericUriParserOptions options   = (GenericUriParserOptions)Enum.Parse(typeof(GenericUriParserOptions), str2);
                SchemeSettingInternal   internal2 = new SchemeSettingInternal(attribute, options);
                this.sectionData.SchemeSettings[internal2.Name] = internal2;
                return(true);
            }
            catch (ArgumentException)
            {
                return(false);
            }
        }
        private bool ReadAddSchemeSetting()
        {
            string schemeValue = reader.GetAttribute(CommonConfigurationStrings.SchemeName);
            string genericUriParserOptionsValue = reader.GetAttribute(
                CommonConfigurationStrings.GenericUriParserOptions);

            if (string.IsNullOrEmpty(schemeValue) || string.IsNullOrEmpty(genericUriParserOptionsValue))
            {
                return false;
            }

            try
            {
                GenericUriParserOptions genericUriParserOptions = (GenericUriParserOptions)Enum.Parse(
                    typeof(GenericUriParserOptions), genericUriParserOptionsValue);

                SchemeSettingInternal schemeSetting = new SchemeSettingInternal(schemeValue,
                    genericUriParserOptions);

                sectionData.SchemeSettings[schemeSetting.Name] = schemeSetting;
                return true;
            }
            catch (ArgumentException)
            {
                return false;
            }
        }
 private bool ReadAddSchemeSetting()
 {
     string attribute = this.reader.GetAttribute("name");
     string str2 = this.reader.GetAttribute("genericUriParserOptions");
     if (string.IsNullOrEmpty(attribute) || string.IsNullOrEmpty(str2))
     {
         return false;
     }
     try
     {
         GenericUriParserOptions options = (GenericUriParserOptions) Enum.Parse(typeof(GenericUriParserOptions), str2);
         SchemeSettingInternal internal2 = new SchemeSettingInternal(attribute, options);
         this.sectionData.SchemeSettings[internal2.Name] = internal2;
         return true;
     }
     catch (ArgumentException)
     {
         return false;
     }
 }