Services created with factories

Topics: CAB & Smart Client Software Factory
Mar 8, 2007 at 4:45 PM
Edited Mar 8, 2007 at 4:47 PM
I have services that can be created by a factories (Using EnterpriseLibrary AssemblerBasedCustomFactory).

With the following code we add the services to the Services collection.

public override void AddServices()
{
base.AddServices();

IMyService service = MyServiceFactory.CreateMyService();
this.rootWorkItem.Services.Add<IMyService>(service);
}

This works fine. But what I want to do is to configure the service via the CompositeUI/services tag in the app.config.

<CompositeUI>
<services>
<add serviceType="MyNamespace.IMyService, MyAssembly" instanceType="?????, ???MyFactoryAssembly" />
</services>
</CompositeUI>

Is this possible?