Hi All,
I have a case where I have to resolve all instances of a specific type
of component. I know that I can use the CollectionResolver class and
then do something like:
var myComponentList = container.Resolve<IList<MyComponent>>();
However, I was unable to find any examples of how to release these
components once I'm done with them. Is it as simple as the following:
container.Release(myComponentList);
Or do I have to manually release them all individually:
foreach (var component in myComponentList)
{
container.Release(component);
}
As a follow-up question, what would be the correct 'release' procedure
if I had used a TypeFactory to resolve the collection, would a
'release' method like the one below work:
interface IMyComponentFactory
{
IList<MyComponent> CreateAllMyComponents();
void DestroyAllMyComponents(IList<MyComponent> components);
}
Thanks in advance for your help.
--
You received this message because you are subscribed to the Google Groups
"Castle Project Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/castle-project-users?hl=en.