Here's an example that I think is in the SM docs somewhere. You need 2.5.2+ for this.
/// <summary>
/// This TypeScanner looks for any concrete class that implements
/// an IFlattenerFor<T> interface, and registers that type
/// against the closed IFlattenerFor<T> interface,
/// i.e. IFlattenerFor<Address> or IFlattenerFor<Site>
/// </summary>
public class DtoFlattenerConventionScanner : ITypeScanner
{
public void Process(Type type, PluginGraph graph)
{
Type interfaceType = type.FindInterfaceThatCloses(typeof (IFlattenerFor<>));
if (interfaceType != null)
{
graph.AddType(interfaceType, type);
}
}
}
Then,
Scan(x => {
x.TheCallingAssembly();
x.With<DtoFlattenerConventionScanner>();
});
Jeremy D. Miller
The Shade Tree Developerjeremy...@yahoo.com