internal ConfigurationCollection(IConfigurationValueCollection defaults) { this.Descriptor = ConfigurationDescriptorCache.GetCollectionDescriptor <T>(); this.collectionInterceptor = new CollectionInterceptor <T>(defaults); this.Configuration = ConfigurationDescriptorCache .GetProxyGenerator().CreateInterfaceProxyWithoutTarget <T> (new CollectionCircularInterceptor <T>(this), this.collectionInterceptor); this.ValueCollection = defaults; }
internal ConfigurationSection(IConfigurationValueCollection values, string sectionKey) { this.Descriptor = new ConfigurationSectionDescriptor <T>(sectionKey); this.configurationInterceptor = new ConfigurationInterceptor(this.Descriptor, values); // if this is a CVC base implementation, we should ensure defaults. (values as ConfigurationValueCollection)?.EnsureSectionDefaults(this.Descriptor); this.ValueCollection = values; this.Configuration = ConfigurationDescriptorCache .GetProxyGenerator() .CreateInterfaceProxyWithoutTarget <T>(new ConfigurationCircularInterceptor <T>(this), configurationInterceptor); }