ImmutableArray.Create 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
| 名称 | 说明 |
|---|---|
| Create<T>(T, T, T, T) |
创建包含指定对象的不可变数组。 |
| Create<T>(T, T, T) |
创建包含指定对象的不可变数组。 |
| Create<T>(ImmutableArray<T>, Int32, Int32) |
使用另一个不可变数组中的指定对象创建不可变数组。 |
| Create<T>(T, T) |
创建包含指定对象的不可变数组。 |
| Create<T>(T[], Int32, Int32) |
使用另一个数组中的指定对象创建不可变数组。 |
| Create<T>(T) |
创建包含指定对象的不可变数组。 |
| Create<T>(Span<T>) |
使用指定的元素创建 ImmutableArray<T>。 |
| Create<T>(ReadOnlySpan<T>) |
使用指定的元素创建 ImmutableArray<T>。 |
| Create<T>() |
创建空的不可变数组。 |
| Create<T>(T[]) |
从指定的对象数组创建不可变数组。 |
Create<T>(T, T, T, T)
- Source:
- ImmutableArray.cs
- Source:
- ImmutableArray.cs
- Source:
- ImmutableArray.cs
- Source:
- ImmutableArray.cs
- Source:
- ImmutableArray.cs
- Source:
- ImmutableArray.cs
创建包含指定对象的不可变数组。
public:
generic <typename T>
static System::Collections::Immutable::ImmutableArray<T> Create(T item1, T item2, T item3, T item4);
public static System.Collections.Immutable.ImmutableArray<T> Create<T>(T item1, T item2, T item3, T item4);
static member Create : 'T * 'T * 'T * 'T -> System.Collections.Immutable.ImmutableArray<'T>
Public Function Create(Of T) (item1 As T, item2 As T, item3 As T, item4 As T) As ImmutableArray(Of T)
类型参数
- T
存储在数组中的元素的类型。
参数
- item1
- T
要存储在数组中的第一个对象。
- item2
- T
要存储在数组中的第二个对象。
- item3
- T
要存储在数组中的第三个对象。
- item4
- T
要存储在数组中的第四个对象。
返回
包含指定对象的不可变数组。
适用于
Create<T>(T, T, T)
- Source:
- ImmutableArray.cs
- Source:
- ImmutableArray.cs
- Source:
- ImmutableArray.cs
- Source:
- ImmutableArray.cs
- Source:
- ImmutableArray.cs
- Source:
- ImmutableArray.cs
创建包含指定对象的不可变数组。
public:
generic <typename T>
static System::Collections::Immutable::ImmutableArray<T> Create(T item1, T item2, T item3);
public static System.Collections.Immutable.ImmutableArray<T> Create<T>(T item1, T item2, T item3);
static member Create : 'T * 'T * 'T -> System.Collections.Immutable.ImmutableArray<'T>
Public Function Create(Of T) (item1 As T, item2 As T, item3 As T) As ImmutableArray(Of T)
类型参数
- T
存储在数组中的元素的类型。
参数
- item1
- T
要存储在数组中的第一个对象。
- item2
- T
要存储在数组中的第二个对象。
- item3
- T
要存储在数组中的第三个对象。
返回
包含指定对象的不可变数组。
适用于
Create<T>(ImmutableArray<T>, Int32, Int32)
- Source:
- ImmutableArray.cs
- Source:
- ImmutableArray.cs
- Source:
- ImmutableArray.cs
- Source:
- ImmutableArray.cs
- Source:
- ImmutableArray.cs
- Source:
- ImmutableArray.cs
使用另一个不可变数组中的指定对象创建不可变数组。
public:
generic <typename T>
static System::Collections::Immutable::ImmutableArray<T> Create(System::Collections::Immutable::ImmutableArray<T> items, int start, int length);
public static System.Collections.Immutable.ImmutableArray<T> Create<T>(System.Collections.Immutable.ImmutableArray<T> items, int start, int length);
static member Create : System.Collections.Immutable.ImmutableArray<'T> * int * int -> System.Collections.Immutable.ImmutableArray<'T>
Public Function Create(Of T) (items As ImmutableArray(Of T), start As Integer, length As Integer) As ImmutableArray(Of T)
类型参数
- T
存储在数组中的元素的类型。
参数
- items
- ImmutableArray<T>
对象的源数组。
- start
- Int32
要从 items中复制的第一个元素的索引。
- length
- Int32
要包含在此不可变数组中的元素 items 数。
返回
包含源数组中的指定对象的不可变数组。
注解
此重载允许帮助程序方法或自定义生成器类有效地避免在新数组是现有数组的段时为复制数组支付冗余税。
适用于
Create<T>(T, T)
- Source:
- ImmutableArray.cs
- Source:
- ImmutableArray.cs
- Source:
- ImmutableArray.cs
- Source:
- ImmutableArray.cs
- Source:
- ImmutableArray.cs
- Source:
- ImmutableArray.cs
创建包含指定对象的不可变数组。
public:
generic <typename T>
static System::Collections::Immutable::ImmutableArray<T> Create(T item1, T item2);
public static System.Collections.Immutable.ImmutableArray<T> Create<T>(T item1, T item2);
static member Create : 'T * 'T -> System.Collections.Immutable.ImmutableArray<'T>
Public Function Create(Of T) (item1 As T, item2 As T) As ImmutableArray(Of T)
类型参数
- T
存储在数组中的元素的类型。
参数
- item1
- T
要存储在数组中的第一个对象。
- item2
- T
要存储在数组中的第二个对象。
返回
包含指定对象的不可变数组。
适用于
Create<T>(T[], Int32, Int32)
- Source:
- ImmutableArray.cs
- Source:
- ImmutableArray.cs
- Source:
- ImmutableArray.cs
- Source:
- ImmutableArray.cs
- Source:
- ImmutableArray.cs
- Source:
- ImmutableArray.cs
使用另一个数组中的指定对象创建不可变数组。
public:
generic <typename T>
static System::Collections::Immutable::ImmutableArray<T> Create(cli::array <T> ^ items, int start, int length);
public static System.Collections.Immutable.ImmutableArray<T> Create<T>(T[] items, int start, int length);
static member Create : 'T[] * int * int -> System.Collections.Immutable.ImmutableArray<'T>
Public Function Create(Of T) (items As T(), start As Integer, length As Integer) As ImmutableArray(Of T)
类型参数
- T
存储在数组中的元素的类型。
参数
- items
- T[]
对象的源数组。
- start
- Int32
要从 items中复制的第一个元素的索引。
- length
- Int32
要包含在此不可变数组中的元素 items 数。
返回
包含源数组中的指定对象的不可变数组。
注解
此重载允许帮助程序方法或自定义生成器类有效地避免在新数组是现有数组的段时为复制数组支付冗余税。
适用于
Create<T>(T)
- Source:
- ImmutableArray.cs
- Source:
- ImmutableArray.cs
- Source:
- ImmutableArray.cs
- Source:
- ImmutableArray.cs
- Source:
- ImmutableArray.cs
- Source:
- ImmutableArray.cs
创建包含指定对象的不可变数组。
public:
generic <typename T>
static System::Collections::Immutable::ImmutableArray<T> Create(T item);
public static System.Collections.Immutable.ImmutableArray<T> Create<T>(T item);
static member Create : 'T -> System.Collections.Immutable.ImmutableArray<'T>
Public Function Create(Of T) (item As T) As ImmutableArray(Of T)
类型参数
- T
存储在数组中的元素的类型。
参数
- item
- T
要存储在数组中的对象。
返回
包含指定对象的不可变数组。
适用于
Create<T>(Span<T>)
- Source:
- ImmutableArray.cs
- Source:
- ImmutableArray.cs
- Source:
- ImmutableArray.cs
- Source:
- ImmutableArray.cs
- Source:
- ImmutableArray.cs
- Source:
- ImmutableArray.cs
使用指定的元素创建 ImmutableArray<T>。
public:
generic <typename T>
static System::Collections::Immutable::ImmutableArray<T> Create(Span<T> items);
[System.Runtime.CompilerServices.OverloadResolutionPriority(-1)]
public static System.Collections.Immutable.ImmutableArray<T> Create<T>(Span<T> items);
public static System.Collections.Immutable.ImmutableArray<T> Create<T>(Span<T> items);
[<System.Runtime.CompilerServices.OverloadResolutionPriority(-1)>]
static member Create : Span<'T> -> System.Collections.Immutable.ImmutableArray<'T>
static member Create : Span<'T> -> System.Collections.Immutable.ImmutableArray<'T>
Public Function Create(Of T) (items As Span(Of T)) As ImmutableArray(Of T)
类型参数
- T
存储在数组中的元素的类型。
参数
- items
- Span<T>
要存储在数组中的元素。
返回
包含指定项的不可变数组。
- 属性
适用于
Create<T>(ReadOnlySpan<T>)
- Source:
- ImmutableArray.cs
- Source:
- ImmutableArray.cs
- Source:
- ImmutableArray.cs
- Source:
- ImmutableArray.cs
- Source:
- ImmutableArray.cs
- Source:
- ImmutableArray.cs
使用指定的元素创建 ImmutableArray<T>。
public:
generic <typename T>
static System::Collections::Immutable::ImmutableArray<T> Create(ReadOnlySpan<T> items);
public static System.Collections.Immutable.ImmutableArray<T> Create<T>(scoped ReadOnlySpan<T> items);
public static System.Collections.Immutable.ImmutableArray<T> Create<T>(ReadOnlySpan<T> items);
static member Create : ReadOnlySpan<'T> -> System.Collections.Immutable.ImmutableArray<'T>
Public Function Create(Of T) (items As ReadOnlySpan(Of T)) As ImmutableArray(Of T)
类型参数
- T
存储在数组中的元素的类型。
参数
- items
- ReadOnlySpan<T>
要存储在数组中的元素。
返回
包含指定项的不可变数组。
适用于
Create<T>()
- Source:
- ImmutableArray.cs
- Source:
- ImmutableArray.cs
- Source:
- ImmutableArray.cs
- Source:
- ImmutableArray.cs
- Source:
- ImmutableArray.cs
- Source:
- ImmutableArray.cs
创建空的不可变数组。
public:
generic <typename T>
static System::Collections::Immutable::ImmutableArray<T> Create();
public static System.Collections.Immutable.ImmutableArray<T> Create<T>();
static member Create : unit -> System.Collections.Immutable.ImmutableArray<'T>
Public Function Create(Of T) () As ImmutableArray(Of T)
类型参数
- T
存储在数组中的元素的类型。
返回
空的不可变数组。
适用于
Create<T>(T[])
- Source:
- ImmutableArray.cs
- Source:
- ImmutableArray.cs
- Source:
- ImmutableArray.cs
- Source:
- ImmutableArray.cs
- Source:
- ImmutableArray.cs
- Source:
- ImmutableArray.cs
从指定的对象数组创建不可变数组。
public:
generic <typename T>
static System::Collections::Immutable::ImmutableArray<T> Create(... cli::array <T> ^ items);
public static System.Collections.Immutable.ImmutableArray<T> Create<T>(params T[] items);
public static System.Collections.Immutable.ImmutableArray<T> Create<T>(params T[]? items);
static member Create : 'T[] -> System.Collections.Immutable.ImmutableArray<'T>
Public Function Create(Of T) (ParamArray items As T()) As ImmutableArray(Of T)
类型参数
- T
存储在数组中的元素的类型。
参数
- items
- T[]
要填充数组的对象数组。
返回
包含项数组的不可变数组。