コード例 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EnvironmentElement"/> class.
 /// </summary>
 public EnvironmentElement()
 {
     this.connectionStrings = new ConnectionStringElementCollection();
     this.settings          = new SettingElementCollection();
     this.urls         = new UrlElementCollection();
     this.applications = new ApplicationElementCollection();
 }
コード例 #2
0
        /// <summary>
        /// Initializes the <see cref="EnvironmentManager"/> class.
        /// </summary>
        static EnvironmentManager()
        {
            var configurationSection = (EnvironmentsSection)ConfigurationManager.GetSection("environments");

            if (configurationSection == null)
            {
                environments = new EnvironmentElementCollection();
            }
            else
            {
                section            = configurationSection;
                environments       = configurationSection.Environments;
                applications       = configurationSection.Applications;
                currentEnvironment = configurationSection.Current;
            }
        }