AlgorithmsReadOnlyT Method (ICollectionT) |
Returns a read-only view onto a collection. The returned ICollection<T> interface
only allows operations that do not change the collection: GetEnumerator, Contains, CopyTo,
Count. The ReadOnly property returns false, indicating that the collection 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 ICollection<T> ReadOnly<T>(
ICollection<T> collection
)
public:
generic<typename T>
static ICollection<T>^ ReadOnly(
ICollection<T>^ collection
)
Parameters
- collection
- Type: System.Collections.GenericICollectionT
The collection to wrap.
Type Parameters
- T
- The type of items in the collection.
Return Value
Type:
ICollectionTA read-only view onto
collection. If
collection is null, then null is returned.
RemarksThe data in the underlying collection is not copied. If the underlying
collection is changed, then the read-only view also changes accordingly.
See Also