Esempio 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;
        }
Esempio 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);
        }