/// <summary> /// Initializes the provider and ensures that all configuration can be read /// </summary> /// <param name="builderContext"></param> public override void Initialise(IBuilderContext builderContext) { Mandate.ParameterNotNull(builderContext, "builderContext"); var configMain = builderContext.ConfigurationResolver.GetConfigSection(HiveConfigSection.ConfigXmlKey) as HiveConfigSection; if (configMain == null) throw new ConfigurationErrorsException( string.Format("Configuration section '{0}' not found when building packaging provider '{1}'", HiveConfigSection.ConfigXmlKey, ProviderKey)); var config2Rw = configMain.Providers.ReadWriters[ProviderKey] ?? configMain.Providers.Readers[ProviderKey]; if (config2Rw == null) throw new ConfigurationErrorsException( string.Format("No configuration found for persistence provider '{0}'", ProviderKey)); //get the Hive provider config section _localConfig = DeepConfigManager.Default.GetFirstPluginSection<ProviderConfigurationSection>(config2Rw.ConfigSectionKey); if (!ValidateProviderConfigSection<MembershipDemandBuilder>(_localConfig, config2Rw)) { CanBuild = false; return; } CanBuild = true; }
/// <summary> /// Initializes a new instance of the <see cref="ProviderBootstrapper"/> class if sufficient configuration information has been supplied by the user. /// </summary> /// <param name="existingConfig">The existing config.</param> /// <param name="frameworkContext"></param> /// <remarks></remarks> public ProviderBootstrapper(ProviderConfigurationSection existingConfig, IFrameworkContext frameworkContext) { _existingConfig = existingConfig; _frameworkContext = frameworkContext; }