AlgorithmsUntypedT Method (IListT) |
Given a generic IList<T> interface, wrap a non-generic (untyped)
IList interface around it. The non-generic interface will contain the same objects as the
underlying generic list, but can be used in places that require a non-generic interface.
This method is useful when interfacing generic interfaces with older code that uses non-generic interfaces.
Namespace: X3Platform.CollectionsAssembly: X3Platform.Support (in X3Platform.Support.dll) Version: 1.0.0.0 (2.0.0.0)
Syntaxpublic static IList Untyped<T>(
IList<T> typedList
)
public:
generic<typename T>
static IList^ Untyped(
IList<T>^ typedList
)
Parameters
- typedList
- Type: System.Collections.GenericIListT
A typed list to wrap.
Type Parameters
- T
- The item type of the underlying list.
Return Value
Type:
IListA non-generic IList wrapper around
typedList.
If
typedList is null, then null is returned.
RemarksMany generic collections already implement the non-generic interfaces directly. This
method will first attempt to simply cast typedList to IList. If that
succeeds, it is returned; if it fails, then a wrapper object is created.
See Also