Example #1
0
        protected override IOProviderData GetConfiguration(string name, IConfigurationSource configurationSource)
        {
            IOProviderSettings settings = configurationSource.GetSection(IOProviderSettings.SectionName) as IOProviderSettings;

            if (null == settings)
            {
                throw new ConfigurationErrorsException(string.Format("The configuration section '{0}' was not found in the configuration", IOProviderSettings.SectionName));
            }

            return(settings.IOProviderPlugins.Get(name));
        }
Example #2
0
        public string MapName(string name, IConfigurationSource configSource)
        {
            if (null == configSource)
            {
                throw new ArgumentNullException("configSource");
            }

            if (null != name)
            {
                return(name);
            }
            else
            {
                IOProviderSettings settings = configSource.GetSection(IOProviderSettings.SectionName) as IOProviderSettings;

                if (null == settings)
                {
                    throw new ConfigurationErrorsException(string.Format("Could not load configuration section {0}", IOProviderSettings.SectionName));
                }

                return(settings.DefaultIOProvider);
            }
        }