Uniquifier.Uniquify Method

Definition

Overloads

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

Creates a unique identifier by appending a number to the given string.

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

Creates a unique identifier by appending a number to the given string.

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

Creates a unique identifier by appending a number to the given string.

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

Type Parameters

T

The type of the object the identifier maps to.

Parameters

currentIdentifier
String

The base identifier.

otherIdentifiers
IReadOnlyDictionary<String,T>

A dictionary where the identifier will be used as a key.

maxLength
Int32

The maximum length of the identifier.

Returns

A unique identifier.

Applies to

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

Creates a unique identifier by appending a number to the given string.

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

Type Parameters

TKey

The type of the key that contains the identifier.

TValue

The type of the object the identifier maps to.

Parameters

currentIdentifier
String

The base identifier.

otherIdentifiers
IReadOnlyDictionary<TKey,TValue>

A dictionary where the identifier will be used as part of the key.

keySelector
Func<String,TKey>

Creates the key object from an identifier.

maxLength
Int32

The maximum length of the identifier.

Returns

A unique identifier.

Applies to