Spring.NET 1.3.0 RC1 for .NET 2.0 API Reference

ObjectFactoryUtils.ObjectNamesForTypeIncludingAncestors(IListableObjectFactory, Type, Boolean, Boolean) Method

Get all object names for the given type, including those defined in ancestor factories.

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

Parameters

factory
If this isn't also an IHierarchicalObjectFactory, this method will return the same as it's own GetObjectDefinitionNames method.
type
The Type that objects must 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 array of object names, or an empty array if none.

Remarks

Will return unique names in case of overridden object definitions.

Does consider objects created by IFactoryObjects if includeFactoryObjects is set to true, which means that IFactoryObjects will get initialized.

See Also

ObjectFactoryUtils Class | Spring.Objects.Factory Namespace | ObjectFactoryUtils.ObjectNamesForTypeIncludingAncestors Overload List