语言

ConcurrentDictionary<TKey,TValue>.TryGetAlternateLookup<TAlternateKey> 方法

定义

获取一个类型的实例,该实例可用于对用作ConcurrentDictionary<TKey,TValue>键而不是键TAlternateKey执行操作TKey。

public:
generic <typename TAlternateKey>
 bool TryGetAlternateLookup([Runtime::InteropServices::Out] System::Collections::Concurrent::ConcurrentDictionary<TKey, TValue>::AlternateLookup<TAlternateKey> % lookup);
public bool TryGetAlternateLookup<TAlternateKey>(out System.Collections.Concurrent.ConcurrentDictionary<TKey,TValue>.AlternateLookup<TAlternateKey> lookup) where TAlternateKey : allows ref struct;
member this.TryGetAlternateLookup : AlternateLookup -> bool
Public Function TryGetAlternateLookup(Of TAlternateKey) (ByRef lookup As ConcurrentDictionary(Of TKey, TValue).AlternateLookup(Of TAlternateKey)) As Boolean

类型参数

TAlternateKey

用于执行查找的键的备用类型。

参数

lookup
ConcurrentDictionary<TKey,TValue>.AlternateLookup<TAlternateKey>

方法返回 true时创建的查找实例,或该方法返回 false时不应使用的默认实例。

返回

true 如果可以创建查找,则为 ;否则,为 false.

注解

此实例必须使用与 实现的比较器。 否则,该方法将返回 false。

适用于