How about something like the following, this allows me to register every implementation of the interface 'IAnimal' and then use 'ResolveAll' to get all implementations back as collection.
Hope it helps
Ollie
class Program
{
static void Main(string[] args)
{
var container = new WindsorContainer();
container.Register(AllTypes.Pick().FromAssembly(Assembly.GetExecutingAssembly()).AllowMultipleMatches());
var dog = container.Resolve<Dog>();
var animals = container.ResolveAll<IAnimal>();
}
}
public interface IAnimal
{
}
public class Dog : IAnimal
{
}
public class Cat : IAnimal
{
}
public class Fish : IAnimal
{
}
AWC
2009-08-21 11:03:57