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);
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);
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.

适用于