ImmutableArray.ToImmutableArray 方法
定義
多載
ToImmutableArray<TSource>(IEnumerable<TSource>) |
從指定的集合建立不可變的陣列。Creates an immutable array from the specified collection. |
ToImmutableArray<TSource>(ImmutableArray<TSource>.Builder) |
從產生器陣列目前內容建立不可變的陣列。Creates an immutable array from the current contents of the builder's array. |
ToImmutableArray<TSource>(IEnumerable<TSource>)
從指定的集合建立不可變的陣列。Creates an immutable array from the specified collection.
public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
static System::Collections::Immutable::ImmutableArray<TSource> ToImmutableArray(System::Collections::Generic::IEnumerable<TSource> ^ items);
public static System.Collections.Immutable.ImmutableArray<TSource> ToImmutableArray<TSource> (this System.Collections.Generic.IEnumerable<TSource> items);
static member ToImmutableArray : seq<'Source> -> System.Collections.Immutable.ImmutableArray<'Source>
<Extension()>
Public Function ToImmutableArray(Of TSource) (items As IEnumerable(Of TSource)) As ImmutableArray(Of TSource)
類型參數
- TSource
items
中所包含之項目的型別。The type of elements contained in items
.
參數
- items
- IEnumerable<TSource>
要複製至不可變陣列之物件的集合。The collection of objects to copy to the immutable array.
傳回
- ImmutableArray<TSource>
不可變的陣列,其中包含指定的物件集合。An immutable array that contains the specified collection of objects.
適用於
ToImmutableArray<TSource>(ImmutableArray<TSource>.Builder)
從產生器陣列目前內容建立不可變的陣列。Creates an immutable array from the current contents of the builder's array.
public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
static System::Collections::Immutable::ImmutableArray<TSource> ToImmutableArray(System::Collections::Immutable::ImmutableArray<TSource>::Builder ^ builder);
public static System.Collections.Immutable.ImmutableArray<TSource> ToImmutableArray<TSource> (this System.Collections.Immutable.ImmutableArray<TSource>.Builder builder);
static member ToImmutableArray : System.Collections.Immutable.ImmutableArray<'Source>.Builder -> System.Collections.Immutable.ImmutableArray<'Source>
<Extension()>
Public Function ToImmutableArray(Of TSource) (builder As ImmutableArray(Of TSource).Builder) As ImmutableArray(Of TSource)
類型參數
- TSource
不可變數組中包含的元素類型。The type of elements contained in the immutable array.
參數
- builder
- ImmutableArray<TSource>.Builder
產生器,用於建立不可變的陣列。The builder to create the immutable array from.
傳回
- ImmutableArray<TSource>
不可變的陣列,其中包含產生器陣列的目前內容。An immutable array that contains the current contents of the builder's array.