Прочетете на английски Редактиране

Споделяне чрез


ImmutableSortedSet.Create Method

Definition

Overloads

Create<T>()

Creates an empty immutable sorted set.

Create<T>(IComparer<T>)

Creates an empty immutable sorted set that uses the specified comparer.

Create<T>(ReadOnlySpan<T>)

Creates a new immutable sorted set that contains the specified array of items.

Create<T>(T)

Creates a new immutable sorted set that contains the specified item.

Create<T>(T[])

Creates a new immutable sorted set that contains the specified array of items.

Create<T>(IComparer<T>, ReadOnlySpan<T>)

Creates a new immutable collection prefilled with the specified items.

Create<T>(IComparer<T>, T)

Creates a new immutable sorted set that contains the specified item and uses the specified comparer.

Create<T>(IComparer<T>, T[])

Creates a new immutable sorted set that contains the specified array of items and uses the specified comparer.

Create<T>()

Source:
ImmutableSortedSet.cs
Source:
ImmutableSortedSet.cs
Source:
ImmutableSortedSet.cs
Source:
ImmutableSortedSet.cs

Creates an empty immutable sorted set.

C#
public static System.Collections.Immutable.ImmutableSortedSet<T> Create<T>();

Type Parameters

T

The type of items to be stored in the immutable set.

Returns

An empty immutable sorted set.

Applies to

.NET 10 и други версии
Продукт Версии
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10
.NET Standard 2.0 (package-provided)
UWP 10.0

Create<T>(IComparer<T>)

Source:
ImmutableSortedSet.cs
Source:
ImmutableSortedSet.cs
Source:
ImmutableSortedSet.cs
Source:
ImmutableSortedSet.cs

Creates an empty immutable sorted set that uses the specified comparer.

C#
public static System.Collections.Immutable.ImmutableSortedSet<T> Create<T>(System.Collections.Generic.IComparer<T> comparer);
C#
public static System.Collections.Immutable.ImmutableSortedSet<T> Create<T>(System.Collections.Generic.IComparer<T>? comparer);

Type Parameters

T

The type of items in the immutable set.

Parameters

comparer
IComparer<T>

The implementation to use when comparing items in the set.

Returns

An empty immutable set.

Applies to

.NET 10 и други версии
Продукт Версии
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10
.NET Standard 2.0 (package-provided)
UWP 10.0

Create<T>(ReadOnlySpan<T>)

Source:
ImmutableSortedSet.cs
Source:
ImmutableSortedSet.cs
Source:
ImmutableSortedSet.cs

Creates a new immutable sorted set that contains the specified array of items.

C#
public static System.Collections.Immutable.ImmutableSortedSet<T> Create<T>(scoped ReadOnlySpan<T> items);
C#
public static System.Collections.Immutable.ImmutableSortedSet<T> Create<T>(ReadOnlySpan<T> items);

Type Parameters

T

The type of items in the immutable set.

Parameters

items
ReadOnlySpan<T>

A span that contains the items to prepopulate the set with.

Returns

A new immutable set that contains the specified items.

Applies to

.NET 10 и други версии
Продукт Версии
.NET 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10
.NET Standard 2.0 (package-provided)

Create<T>(T)

Source:
ImmutableSortedSet.cs
Source:
ImmutableSortedSet.cs
Source:
ImmutableSortedSet.cs
Source:
ImmutableSortedSet.cs

Creates a new immutable sorted set that contains the specified item.

C#
public static System.Collections.Immutable.ImmutableSortedSet<T> Create<T>(T item);

Type Parameters

T

The type of items in the immutable set.

Parameters

item
T

The item to prepopulate the set with.

Returns

A new immutable set that contains the specified item.

Applies to

.NET 10 и други версии
Продукт Версии
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10
.NET Standard 2.0 (package-provided)
UWP 10.0

Create<T>(T[])

Source:
ImmutableSortedSet.cs
Source:
ImmutableSortedSet.cs
Source:
ImmutableSortedSet.cs
Source:
ImmutableSortedSet.cs

Creates a new immutable sorted set that contains the specified array of items.

C#
public static System.Collections.Immutable.ImmutableSortedSet<T> Create<T>(params T[] items);

Type Parameters

T

The type of items in the immutable set.

Parameters

items
T[]

An array that contains the items to prepopulate the set with.

Returns

A new immutable set that contains the specified items.

Applies to

.NET 10 и други версии
Продукт Версии
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10
.NET Standard 2.0 (package-provided)
UWP 10.0

Create<T>(IComparer<T>, ReadOnlySpan<T>)

Source:
ImmutableSortedSet.cs
Source:
ImmutableSortedSet.cs
Source:
ImmutableSortedSet.cs

Creates a new immutable collection prefilled with the specified items.

C#
public static System.Collections.Immutable.ImmutableSortedSet<T> Create<T>(System.Collections.Generic.IComparer<T>? comparer, scoped ReadOnlySpan<T> items);
C#
public static System.Collections.Immutable.ImmutableSortedSet<T> Create<T>(System.Collections.Generic.IComparer<T>? comparer, ReadOnlySpan<T> items);

Type Parameters

T

The type of items stored by the collection.

Parameters

comparer
IComparer<T>

The comparer.

items
ReadOnlySpan<T>

The items to prepopulate.

Returns

The new immutable collection.

Applies to

.NET 10 и други версии
Продукт Версии
.NET 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10
.NET Standard 2.0 (package-provided)

Create<T>(IComparer<T>, T)

Source:
ImmutableSortedSet.cs
Source:
ImmutableSortedSet.cs
Source:
ImmutableSortedSet.cs
Source:
ImmutableSortedSet.cs

Creates a new immutable sorted set that contains the specified item and uses the specified comparer.

C#
public static System.Collections.Immutable.ImmutableSortedSet<T> Create<T>(System.Collections.Generic.IComparer<T> comparer, T item);
C#
public static System.Collections.Immutable.ImmutableSortedSet<T> Create<T>(System.Collections.Generic.IComparer<T>? comparer, T item);

Type Parameters

T

The type of items stored in the immutable set.

Parameters

comparer
IComparer<T>

The implementation to use when comparing items in the set.

item
T

The item to prepopulate the set with.

Returns

A new immutable set that contains the specified item.

Applies to

.NET 10 и други версии
Продукт Версии
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10
.NET Standard 2.0 (package-provided)
UWP 10.0

Create<T>(IComparer<T>, T[])

Source:
ImmutableSortedSet.cs
Source:
ImmutableSortedSet.cs
Source:
ImmutableSortedSet.cs
Source:
ImmutableSortedSet.cs

Creates a new immutable sorted set that contains the specified array of items and uses the specified comparer.

C#
public static System.Collections.Immutable.ImmutableSortedSet<T> Create<T>(System.Collections.Generic.IComparer<T> comparer, params T[] items);
C#
public static System.Collections.Immutable.ImmutableSortedSet<T> Create<T>(System.Collections.Generic.IComparer<T>? comparer, params T[] items);

Type Parameters

T

The type of items in the immutable set.

Parameters

comparer
IComparer<T>

The implementation to use when comparing items in the set.

items
T[]

An array that contains the items to prepopulate the set with.

Returns

A new immutable set that contains the specified items.

Applies to

.NET 10 и други версии
Продукт Версии
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10
.NET Standard 2.0 (package-provided)
UWP 10.0