Windows apps
Collapse the table of content
Expand the table of content

ReadOnlyCollection<T>.IList<T>.Item Property (Int32)

 

Gets the element at the specified index. An NotSupportedException occurs if you try to set the item at the specified index.

Namespace:   System.Collections.ObjectModel
Assembly:  mscorlib (in mscorlib.dll)

T IList<T>.this[
	int index
] { get; set; }

Parameters

index
Type: System.Int32

The zero-based index of the element to get.

Property Value

Type: T

The element at the specified index.

Exception Condition
NotSupportedException

Always thrown if the property is set.

Because the collection is read-only, you can only get this item at the specified index. An exception will occur if you try to set the item. This member is an explicit interface member implementation. It can be used only when the ReadOnlyCollection<T> instance is cast to an IList<T> interface.

Universal Windows Platform
Available since 8
.NET Framework
Available since 2.0
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
Show:
© 2016 Microsoft