Uniquifier.Uniquify 方法

定义

重载

Uniquify<T>(String, IReadOnlyDictionary<String,T>, Int32)

通过将数字追加到给定字符串来创建唯一标识符。

Uniquify<TKey,TValue>(String, IReadOnlyDictionary<TKey,TValue>, Func<String,TKey>, Int32)

通过将数字追加到给定字符串来创建唯一标识符。

Uniquify<T>(String, IReadOnlyDictionary<String,T>, Int32)

通过将数字追加到给定字符串来创建唯一标识符。

public static string Uniquify<T> (string currentIdentifier, System.Collections.Generic.IReadOnlyDictionary<string,T> otherIdentifiers, int maxLength);
static member Uniquify : string * System.Collections.Generic.IReadOnlyDictionary<string, 'T> * int -> string
Public Shared Function Uniquify(Of T) (currentIdentifier As String, otherIdentifiers As IReadOnlyDictionary(Of String, T), maxLength As Integer) As String

类型参数

T

标识符映射到的对象的类型。

参数

currentIdentifier
String

基标识符。

otherIdentifiers
IReadOnlyDictionary<String,T>

标识符将用作键的字典。

maxLength
Int32

标识符的最大长度。

返回

唯一标识符。

适用于

Uniquify<TKey,TValue>(String, IReadOnlyDictionary<TKey,TValue>, Func<String,TKey>, Int32)

通过将数字追加到给定字符串来创建唯一标识符。

public static string Uniquify<TKey,TValue> (string currentIdentifier, System.Collections.Generic.IReadOnlyDictionary<TKey,TValue> otherIdentifiers, Func<string,TKey> keySelector, int maxLength);
static member Uniquify : string * System.Collections.Generic.IReadOnlyDictionary<'Key, 'Value> * Func<string, 'Key> * int -> string
Public Shared Function Uniquify(Of TKey, TValue) (currentIdentifier As String, otherIdentifiers As IReadOnlyDictionary(Of TKey, TValue), keySelector As Func(Of String, TKey), maxLength As Integer) As String

类型参数

TKey

包含标识符的密钥的类型。

TValue

标识符映射到的对象的类型。

参数

currentIdentifier
String

基标识符。

otherIdentifiers
IReadOnlyDictionary<TKey,TValue>

标识符将用作键的一部分的字典。

keySelector
Func<String,TKey>

从标识符创建密钥对象。

maxLength
Int32

标识符的最大长度。

返回

唯一标识符。

适用于