private static TreeStructuredTypeConfigCollection LoadYetAnotherTypeConfigCollection(string configSectionFullName) { TreeStructuredTypeConfigCollection result = null; var configurationSection = ConfigurationManager.GetSection(configSectionFullName); if (configurationSection != null) { var yetAnotherTypeConfigCollectionProvider = configurationSection as IYetAnotherTypeConfigCollectionProvider; if (yetAnotherTypeConfigCollectionProvider != null) { result = yetAnotherTypeConfigCollectionProvider.GetYetAnotherTypeConfigCollection(); } } return(result); }
/// <summary> /// Creates new instance of <see cref="ConfigFileYetAnotherTypeStructureProvider"/> /// </summary> /// <param name="configSectionFullName">config section full name</param> public ConfigFileYetAnotherTypeStructureProvider(string configSectionFullName) { this.yetAnotherTypeConfigCollection = LoadYetAnotherTypeConfigCollection(configSectionFullName); }