Created
May 9, 2010 09:15
-
-
Save kkozmic/395045 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Helper class used by <see cref="FromAssembly"/> to filter/order and instantiate <see cref="IWindsorInstaller"/> implementations | |
/// </summary> | |
public class InstallerFactory | |
{ | |
/// <summary> | |
/// Performs custom filtering/ordering of given set of types. | |
/// </summary> | |
/// <param name="installerTypes">Set of concrete class types implementing <see cref="IWindsorInstaller"/> interface.</param> | |
/// <returns>Transformed <paramref name="installerTypes"/>.</returns> | |
/// <remarks>Default implementation simply returns types passed into it.</remarks> | |
public virtual IEnumerable<Type> Select(IEnumerable<Type> installerTypes) | |
{ | |
return installerTypes; | |
} | |
/// <summary> | |
/// Performs custom instantiation of given <see cref="installerType"/> | |
/// </summary> | |
/// <remarks> | |
/// Default implementation uses public parameterless constructor to create the instance. | |
/// </remarks> | |
public virtual IWindsorInstaller CreateInstance(Type installerType) | |
{ | |
return ReflectionUtil.CreateInstance<IWindsorInstaller>(installerType); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment