AlgorithmsReadOnlyT Method (IListT) |
Returns a read-only view onto a list. The returned IList<T> interface
only allows operations that do not change the list: GetEnumerator, Contains, CopyTo,
Count, IndexOf, and the get accessor of the indexer.
The IsReadOnly property returns true, indicating that the list is read-only. All other
methods on the interface throw a NotSupportedException.
Namespace: X3Platform.CollectionsAssembly: X3Platform.Support (in X3Platform.Support.dll) Version: 1.0.0.0 (2.0.0.0)
Syntaxpublic static IList<T> ReadOnly<T>(
IList<T> list
)
public:
generic<typename T>
static IList<T>^ ReadOnly(
IList<T>^ list
)
Parameters
- list
- Type: System.Collections.GenericIListT
The list to wrap.
Type Parameters
- T
- The type of items in the list.
Return Value
Type:
IListTA read-only view onto
list. Returns null if
list is null.
If
list is already read-only, returns
list.
RemarksThe data in the underlying list is not copied. If the underlying
list is changed, then the read-only view also changes accordingly.
See Also