ReadOnlyCollectionBuilder<T>.ToReadOnlyCollection Method
Microsoft Silverlight will reach end of support after October 2021. Learn more.
Creates a ReadOnlyCollection<T> containing all of the elements of the ReadOnlyCollectionBuilder<T>, avoiding copying the elements to the new array if possible. Resets the ReadOnlyCollectionBuilder<T> after the ReadOnlyCollection<T> has been created.
Namespace: System.Runtime.CompilerServices
Assembly: System.Core (in System.Core.dll)
Syntax
'Declaration
Public Function ToReadOnlyCollection As ReadOnlyCollection(Of T)
public ReadOnlyCollection<T> ToReadOnlyCollection()
Return Value
Type: System.Collections.ObjectModel.ReadOnlyCollection<T>
A new instance of ReadOnlyCollection<T>.
Version Information
Silverlight
Supported in: 5, 4
Platforms
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.