I have always been looking for unit test the best way to find out how to use an open source project. The lock has a free interface that allows you to do everything in code. From WindsorDotNet2Tests test case:
[Test] public void ParentResolverIntercetorShouldNotAffectGenericComponentInterceptor() { WindsorContainer container = new WindsorContainer(); container.AddComponent<MyInterceptor>(); container.Register( Component.For<ISpecification>() .ImplementedBy<MySpecification>() .Interceptors(new InterceptorReference(typeof(MyInterceptor))) .Anywhere ); container.AddComponent("repos", typeof(IRepository<>), typeof(TransientRepository<>)); ISpecification specification = container.Resolve<ISpecification>(); bool isProxy = specification.Repository.GetType().FullName.Contains("Proxy"); Assert.IsFalse(isProxy); }
And for more, check out ComponentRegistrationTestCase and AllTypesTestCase
There is also a DSL for this, this is my preferred option as it really simplifies things and offers a lot of expansion options. The DSL is called Binsor, which you can read about here: http://www.ayende.com/Blog/archive/7268.aspx But again, Unit Tests is the best place for information. This is an example of code that can be used with a binsor:
for type in AllTypesBased of IController("Company.Web.Controller"): component type
These two lines will ever register a type that inherits the IController interface in the container: D
source share