Dictionary<TKey,TValue>.TryGetAlternateLookup<TAlternateKey> メソッド

定義

Dictionary<TKey,TValue>の代わりにキーとしてTAlternateKeyを使用して、現在のTKeyに対する操作を実行するために使用できる型のインスタンスを取得します。

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

型パラメーター

TAlternateKey

検索を実行するためのキーの代替型。

パラメーター

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

メソッドが true を返すときに作成された参照インスタンス、またはメソッドが false を返す場合に使用しない既定のインスタンス。

返品

true ルックアップを作成できる場合。それ以外の場合は false

注釈

ディクショナリでは、TAlternateKeyTKeyIAlternateEqualityComparer<TAlternate,T>を実装する比較子を使用する必要があります。 そうでない場合、メソッドは falseを返します。

適用対象