Clone this wiki locally
Castle Windsor supports registrations provided by a Fluent API and XML configuration. Agent Mulder plugin currently has a limited support for the Fluent API only.
The following registration patterns are currently supported (via
IWindsorContainer.Register(params IRegistration) method, directly on the
WindsorContainer instance or via a Windsor Installer.
Manual (or one-by-one) registration is done via the
Castle.MicroKernel.Registration.Component class. The only methods Agent Mulder plugin inspects are
ImplementedBy, other methods are currently ignored.
Component.For<IFoo>().ImplementedBy<Foo>()- matches the concrete type
Component.For<Foo>()- matches the concrete type
And their non-generic variants:
Open generic types are supported using the non-generic overloads:
In addition to registering the types one-by-one, Agent Mulder plugin supports analyzing convention-based registration.
From(typeof(Foo), typeof(Bar))- matches
FromThisAssembly- adds an assembly constraint for the assembly (or module) in which registration takes place.
FromAssembly- currently supports
typeof(Foo).Assembly. Other assembly sources, including local variables are currently not supported.
FromAssemblyContaining- both generic and non generic variants
Additional filtering then can be performed using:
BasedOn<IFoo>()- will only select those types that are based on
IFoofrom the above descriptor
BasedOn(typeof(IFoo))- the non generic variant of the above
InNamespace(string, bool)- matches types with the specified namespace (or starting with a specified namespace)
InSameNamespaceAs<IFoo>(bool)- matches types based on the specified generic parameter namespace (or starting with that namespace)
InSameNamespaceAs(Type, bool)- same as the generic variant, takes an optional boolean for subnamespaces (i.e. starting with the type's namespace)
Note: Currently, only direct
false values supported for the argument, not local variables, e.g.:
bool includeSubnamspaces = true; ...IsInSameNamespaceAs<IFoo>(includeSubnamspaces)
Where- currently supported are only predicates generated with the
Component.IsInNamespace(string, boolean)- matches types with the specified namespace (or starting with a specified namespace)
Component.HasAttribute<T>(Type)- matches types that are decorated with an attribute
T. Note: currently supported only as method group, i.e.:
Not (yet) supported
FromAssembly- see above
Where- see above
AsFactory()- how would you highlight a factory interface with no impl?