Spring.NET 1.3.0 RC1 for .NET 2.0 API Reference

ObjectFactoryUtils.ObjectsOfTypeIncludingAncestors Method

Return all objects of the given type or subtypes, also picking up objects defined in ancestor object factories if the current object factory is an IHierarchicalObjectFactory.

[Visual Basic]
Public Shared Sub ObjectsOfTypeIncludingAncestors( _
   ByVal factory As IListableObjectFactory, _
   ByVal type As Type, _
   ByVal includePrototypes As Boolean, _
   ByVal includeFactoryObjects As Boolean _
)
[C#]
public static IDictionary ObjectsOfTypeIncludingAncestors(
   IListableObjectFactory factory,
   Type type,
   bool includePrototypes,
   bool includeFactoryObjects
);

Parameters

factory
The object factory.
type
The Type of object to match.
includePrototypes
Whether to include prototype objects too or just singletons (also applies to IFactoryObject instances).
includeFactoryObjects
Whether to include IFactoryObject instances too or just normal objects.

Return Value

The IDictionary of object instances, or an empty IDictionary if none.

Remarks

The return list will only contain objects of this type. Useful convenience method when we don't care about object names.

Exceptions

Exception Type Condition
ObjectsException If the objects could not be created.

See Also

ObjectFactoryUtils Class | Spring.Objects.Factory Namespace