Exemplo n.º 1
0
        public static ConfigurationBase getConfiguration()
        {
            var configuration = new ConfigurationBase();

            // Get the appSettings.
            NameValueCollection appSettings =
                 ConfigurationManager.AppSettings;

            // Get the collection enumerator.
            IEnumerator appSettingsEnum =
                appSettings.Keys.GetEnumerator();

            // Loop through the collection and
            // display the appSettings key, value pairs.
            while (appSettingsEnum.MoveNext())
            {
                if (appSettingsEnum.Current is String)
                {
                    var keyName = (String)appSettingsEnum.Current;
                    configuration.loadConfiguration(keyName, appSettings[keyName]);
                }
            }
            return configuration;
        }
Exemplo n.º 2
0
        public static ConfigurationBase getConfiguration()
        {
            var configuration = new ConfigurationBase();

            // Get the appSettings.
            NameValueCollection appSettings =
                ConfigurationManager.AppSettings;

            // Get the collection enumerator.
            IEnumerator appSettingsEnum =
                appSettings.Keys.GetEnumerator();

            // Loop through the collection and
            // display the appSettings key, value pairs.
            while (appSettingsEnum.MoveNext())
            {
                if (appSettingsEnum.Current is String)
                {
                    var keyName = (String)appSettingsEnum.Current;
                    configuration.loadConfiguration(keyName, appSettings[keyName]);
                }
            }
            return(configuration);
        }