/// <summary>
 /// Shortcut method to create a composite of specified <see cref="CompositeModelType"/> without further setting up of <see cref="CompositeBuilder"/>.
 /// </summary>
 /// <typeparam name="TComposite">The type of the composite.</typeparam>
 /// <param name="ssp">The <see cref="StructureServiceProvider"/>.</param>
 /// <param name="compositeModelType">The <see cref="CompositeModelType"/> of the composite.</param>
 /// <returns>A new instance of composite with given <see cref="CompositeModelType"/>.</returns>
 /// <exception cref="NullReferenceException">If <paramref name="ssp"/> is <c>null</c>.</exception>
 /// <remarks>
 /// See <see cref="StructureServiceProvider.NewCompositeBuilder(CompositeModelType, IEnumerable{Type})"/> and <see cref="CompositeBuilder.InstantiateWithType(Type)"/> methods for more exception scenarios.
 /// </remarks>
 /// <seealso cref="StructureServiceProvider.NewCompositeBuilder(CompositeModelType, IEnumerable{Type})"/>
 /// <seealso cref="CompositeBuilder.InstantiateWithType(Type)"/>
 public static TComposite NewComposite <TComposite>(this StructureServiceProvider ssp, CompositeModelType compositeModelType)
 {
     return(ssp.NewCompositeBuilder <TComposite>(compositeModelType).Instantiate());
 }
 /// <summary>
 /// Helper method to create new <see cref="CompositeBuilder"/> for plain composites (compositem odel type of <see cref="CompositeModelType.PLAIN"/>) with given types to be used as search criterion.
 /// </summary>
 /// <param name="ssp">The <see cref="StructureServiceProvider"/>.</param>
 /// <param name="compositeTypes">The types of the plain composite.</param>
 /// <returns>A new instance of <see cref="CompositeBuilder"/> for plain composites, matching the search criteria.</returns>
 /// <exception cref="NullReferenceException">If <paramref name="ssp"/> is <c>null</c>.</exception>
 /// <remarks>
 /// See <see cref="StructureServiceProvider.NewCompositeBuilder(CompositeModelType, IEnumerable{Type})"/> method for more exception scenarios.
 /// </remarks>
 /// <seealso cref="StructureServiceProvider.NewCompositeBuilder(CompositeModelType, IEnumerable{Type})"/>
 public static CompositeBuilder NewPlainCompositeBuilder(this StructureServiceProvider ssp, IEnumerable <Type> compositeTypes)
 {
     return(ssp.NewCompositeBuilder(CompositeModelType.PLAIN, compositeTypes));
 }
 /// <summary>
 /// Helper method to create new <see cref="CompositeBuilder"/> for plain composites (composite model type of <see cref="CompositeModelType.PLAIN"/>) with only one type to be used as search criterion.
 /// </summary>
 /// <param name="ssp">The <see cref="StructureServiceProvider"/>.</param>
 /// <param name="compositeType">The type of the plain composite.</param>
 /// <returns>A new instance of <see cref="CompositeBuilder"/> for plain composites, matching the search criteria.</returns>
 /// <exception cref="NullReferenceException">If <paramref name="ssp"/> is <c>null</c>.</exception>
 /// <remarks>
 /// See <see cref="StructureServiceProvider.NewCompositeBuilder(CompositeModelType, IEnumerable{Type})"/> method for more exception scenarios.
 /// </remarks>
 /// <seealso cref="StructureServiceProvider.NewCompositeBuilder(CompositeModelType, IEnumerable{Type})"/>
 public static CompositeBuilder NewPlainCompositeBuilder(this StructureServiceProvider ssp, Type compositeType)
 {
     return(ssp.NewCompositeBuilder(CompositeModelType.PLAIN, compositeType.Singleton()));
 }
 /// <summary>
 /// Helper method to create new <see cref="CompositeBuilder"/> for plain composites (composite model type of <see cref="CompositeModelType.PLAIN"/>) with only one type, known at compile time, to be used as search criterion.
 /// </summary>
 /// <typeparam name="TComposite">The type of the plain composite.</typeparam>
 /// <param name="ssp">The <see cref="StructureServiceProvider"/>.</param>
 /// <returns>A new instance of <see cref="CompositeBuilderInfo{T}"/> for plain composites, matching the search criteria.</returns>
 /// <exception cref="NullReferenceException">If <paramref name="ssp"/> is <c>null</c>.</exception>
 /// <remarks>
 /// See <see cref="StructureServiceProvider.NewCompositeBuilder(CompositeModelType, IEnumerable{Type})"/> method for more exception scenarios.
 /// </remarks>
 /// <seealso cref="StructureServiceProvider.NewCompositeBuilder(CompositeModelType, IEnumerable{Type})"/>
 /// <seealso cref="CompositeBuilderInfo{T}"/>
 public static CompositeBuilderInfo <TComposite> NewPlainCompositeBuilder <TComposite>(this StructureServiceProvider ssp)
 {
     return(ssp.NewCompositeBuilder <TComposite>(CompositeModelType.PLAIN));
 }
 /// <summary>
 /// Helper method to create new composite builder with specified <see cref="CompositeModelType"/> and only one type, known at compile time, to be used as search criteria.
 /// </summary>
 /// <typeparam name="TComposite">The type of the composite, to be used as search criterion when searching for suitable composite model.</typeparam>
 /// <param name="ssp">The <see cref="StructureServiceProvider"/></param>
 /// <param name="compositeModelType">The <see cref="CompositeModelType"/> to be used when searching for suitable composite model.</param>
 /// <returns>A new <see cref="CompositeBuilderInfo{T}"/> instance matching the search criteria.</returns>
 /// <exception cref="NullReferenceException">If <paramref name="ssp"/> is <c>null</c>.</exception>
 /// <remarks>
 /// See <see cref="StructureServiceProvider.NewCompositeBuilder(CompositeModelType, IEnumerable{Type})"/> method for more exception scenarios.
 /// </remarks>
 /// <seealso cref="StructureServiceProvider.NewCompositeBuilder(CompositeModelType, IEnumerable{Type})"/>
 /// <seealso cref="CompositeBuilderInfo{T}"/>
 public static CompositeBuilderInfo <TComposite> NewCompositeBuilder <TComposite>(this StructureServiceProvider ssp, CompositeModelType compositeModelType)
 {
     return(new CompositeBuilderInfo <TComposite>(ssp.NewCompositeBuilder(compositeModelType, typeof(TComposite).Singleton())));
 }
예제 #6
0
 /// <summary>
 /// Helper to create a new <see cref="CompositeBuilder"/> from a specific <see cref="CompositeModel"/>.
 /// </summary>
 /// <param name="ssp">The <see cref="StructureServiceProvider"/>.</param>
 /// <param name="model">The <see cref="CompositeModel"/> of the composite.</param>
 /// <returns>A <see cref="CompositeBuilder"/> to build instances of composites modeled by <see cref="CompositeModel"/>.</returns>
 /// <exception cref="NullReferenceException">If <paramref name="ssp"/> is <c>null</c>.</exception>
 /// <remarks>See <see cref="StructureServiceProvider.NewCompositeBuilder(CompositeModelType, System.Collections.Generic.IEnumerable{Type})"/> method for more exception scenarios.</remarks>
 public static CompositeBuilder NewCompositeBuilder(this StructureServiceProvider ssp, CompositeModel model)
 {
     return(ssp.NewCompositeBuilder(model.ModelType, model.PublicTypes));
 }