internal ConfigurationManagerDeclarationImpl(ServiceCompositeAssemblyDeclaration decl, ConfigurationManagerInfo info) { ArgumentValidator.ValidateNotNull("Service declaration", decl); ArgumentValidator.ValidateNotNull("Configuration manager info", info); this._decl = decl; this._info = info; }
/// <summary> /// Adds support for using <see cref="ConfigurationManager"/> service in <see cref="Assembler"/>. /// </summary> /// <param name="assembler">The <see cref="Assembler"/> to add service contents to.</param> /// <returns>The <see cref="ConfigurationManagerDeclaration"/> object to further set up the <see cref="ConfigurationManager"/> service.</returns> /// <exception cref="NullReferenceException">If <paramref name="assembler"/> is <c>null</c>.</exception> /// <seealso cref="ConfigurationManagerDeclaration"/> /// <remarks> /// If <paramref name="assembler"/> is <see cref="LayeredCompositeAssembler"/>, the service will have <see cref="Visibility.APPLICATION"/> visibility. /// It is possible to change visibility through <see cref="ConfigurationManagerDeclaration.ServiceDeclaration"/> property. /// </remarks> public static ConfigurationManagerDeclaration AddSupportForConfigurationManager(this Assembler assembler) { ServiceCompositeAssemblyDeclaration sDecl; ConfigurationManagerInfo info; if (assembler.ForNewOrExistingService(new Type[] { typeof(ConfigurationManager) }, out sDecl)) { sDecl.WithMixins(typeof(ConfigurationManagerMixin)); info = new ConfigurationManagerInfo(); sDecl.Use(info); if (sDecl is LayeredAbstractCompositeAssemblyDeclaration) { ((LayeredAbstractCompositeAssemblyDeclaration)sDecl).VisibleIn(Visibility.APPLICATION); } } else { info = sDecl.Get <ConfigurationManagerInfo>(); } return(new ConfigurationManagerDeclarationImpl(sDecl, info)); }
internal ConfigurationCompositeDefaultInfoImpl(ConfigurationManagerDeclaration assemblyDeclaration, ConfigurationManagerInfo info, Type[] types) { this._assemblyDeclaration = assemblyDeclaration; this._info = info; this._types = types; }