Beispiel #1
0
        public ExternalDataExchangeService(NameValueCollection parameters) : this()
        {
            if (parameters == null)
            {
                throw new ArgumentNullException("parameters");
            }
            string sectionName = null;

            foreach (string str2 in parameters.Keys)
            {
                if (!str2.Equals("ConfigurationSection", StringComparison.OrdinalIgnoreCase))
                {
                    throw new ArgumentException(string.Format(Thread.CurrentThread.CurrentCulture, SR.GetString("Error_UnknownConfigurationParameter"), new object[] { str2 }), "parameters");
                }
                sectionName = parameters[str2];
            }
            if (sectionName != null)
            {
                this.settings = ConfigurationManager.GetSection(sectionName) as ExternalDataExchangeServiceSection;
                if (this.settings == null)
                {
                    throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, SR.GetString("Error_ConfigurationSectionNotFound"), new object[] { sectionName }));
                }
            }
        }
        public ExternalDataExchangeService(NameValueCollection parameters)
            : this()
        {
            if (parameters == null)
            {
                throw new ArgumentNullException("parameters");
            }
            string configurationSectionName = null;

            foreach (string key in parameters.Keys)
            {
                if (key.Equals(configurationSectionAttributeName, StringComparison.OrdinalIgnoreCase))
                {
                    configurationSectionName = parameters[key];
                }
                else
                {
                    throw new ArgumentException(
                              String.Format(Thread.CurrentThread.CurrentCulture, SR.GetString(SR.Error_UnknownConfigurationParameter), key), "parameters");
                }
            }
            if (configurationSectionName != null)
            {
                settings = ConfigurationManager.GetSection(configurationSectionName) as ExternalDataExchangeServiceSection;
                if (settings == null)
                {
                    throw new ArgumentException(String.Format(CultureInfo.CurrentCulture,
                                                              SR.GetString(SR.Error_ConfigurationSectionNotFound), configurationSectionName));
                }
            }
        }
 public ExternalDataExchangeService(ExternalDataExchangeServiceSection settings) : this()
 {
     if (settings == null)
     {
         throw new ArgumentNullException("settings");
     }
     this.settings = settings;
 }
Beispiel #4
0
 public ExternalDataExchangeService(ExternalDataExchangeServiceSection settings) : this()
 {
     if (settings == null)
     {
         throw new ArgumentNullException("settings");
     }
     this.settings = settings;
 }
        public ExternalDataExchangeService(string configSectionName)
            : this()
        {
            if (configSectionName == null)
                throw new ArgumentNullException("configSectionName");

            settings = ConfigurationManager.GetSection(configSectionName) as ExternalDataExchangeServiceSection;
            if (settings == null)
                throw new ArgumentException(String.Format(CultureInfo.CurrentCulture,
                    SR.GetString(SR.Error_ConfigurationSectionNotFound), configSectionName));
        }
 public ExternalDataExchangeService(string configSectionName) : this()
 {
     if (configSectionName == null)
     {
         throw new ArgumentNullException("configSectionName");
     }
     this.settings = ConfigurationManager.GetSection(configSectionName) as ExternalDataExchangeServiceSection;
     if (this.settings == null)
     {
         throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, SR.GetString("Error_ConfigurationSectionNotFound"), new object[] { configSectionName }));
     }
 }
Beispiel #7
0
 public ExternalDataExchangeService(string configSectionName) : this()
 {
     if (configSectionName == null)
     {
         throw new ArgumentNullException("configSectionName");
     }
     this.settings = ConfigurationManager.GetSection(configSectionName) as ExternalDataExchangeServiceSection;
     if (this.settings == null)
     {
         throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, SR.GetString("Error_ConfigurationSectionNotFound"), new object[] { configSectionName }));
     }
 }
 public ExternalDataExchangeService(NameValueCollection parameters) : this()
 {
     if (parameters == null)
     {
         throw new ArgumentNullException("parameters");
     }
     string sectionName = null;
     foreach (string str2 in parameters.Keys)
     {
         if (!str2.Equals("ConfigurationSection", StringComparison.OrdinalIgnoreCase))
         {
             throw new ArgumentException(string.Format(Thread.CurrentThread.CurrentCulture, SR.GetString("Error_UnknownConfigurationParameter"), new object[] { str2 }), "parameters");
         }
         sectionName = parameters[str2];
     }
     if (sectionName != null)
     {
         this.settings = ConfigurationManager.GetSection(sectionName) as ExternalDataExchangeServiceSection;
         if (this.settings == null)
         {
             throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, SR.GetString("Error_ConfigurationSectionNotFound"), new object[] { sectionName }));
         }
     }
 }
        public ExternalDataExchangeService(NameValueCollection parameters)
            : this()
        {
            if (parameters == null)
                throw new ArgumentNullException("parameters");
            string configurationSectionName = null;

            foreach (string key in parameters.Keys)
            {
                if (key.Equals(configurationSectionAttributeName, StringComparison.OrdinalIgnoreCase))
                {
                    configurationSectionName = parameters[key];
                }
                else
                {
                    throw new ArgumentException(
                        String.Format(Thread.CurrentThread.CurrentCulture, SR.GetString(SR.Error_UnknownConfigurationParameter), key), "parameters");
                }
            }
            if (configurationSectionName != null)
            {
                settings = ConfigurationManager.GetSection(configurationSectionName) as ExternalDataExchangeServiceSection;
                if (settings == null)
                    throw new ArgumentException(String.Format(CultureInfo.CurrentCulture,
                        SR.GetString(SR.Error_ConfigurationSectionNotFound), configurationSectionName));
            }

        }