Observable.ToDictionary<TSource、TKey、TElement> メソッド (IObservable<TSource>、Func<TSource、TKey>、Func<TSource、TElement>)

指定したキー セレクター関数と要素セレクター関数に従って、監視可能なシーケンスからディクショナリを作成します。

Namespace:System.Reactive.Linq
アセンブリ: System.Reactive (System.Reactive.dll)

構文

'Declaration
<ExtensionAttribute> _
Public Shared Function ToDictionary(Of TSource, TKey, TElement) ( _
    source As IObservable(Of TSource), _
    keySelector As Func(Of TSource, TKey), _
    elementSelector As Func(Of TSource, TElement) _
) As IObservable(Of IDictionary(Of TKey, TElement))
'Usage
Dim source As IObservable(Of TSource)
Dim keySelector As Func(Of TSource, TKey)
Dim elementSelector As Func(Of TSource, TElement)
Dim returnValue As IObservable(Of IDictionary(Of TKey, TElement))

returnValue = source.ToDictionary(keySelector, _
    elementSelector)
public static IObservable<IDictionary<TKey, TElement>> ToDictionary<TSource, TKey, TElement>(
    this IObservable<TSource> source,
    Func<TSource, TKey> keySelector,
    Func<TSource, TElement> elementSelector
)
[ExtensionAttribute]
public:
generic<typename TSource, typename TKey, typename TElement>
static IObservable<IDictionary<TKey, TElement>^>^ ToDictionary(
    IObservable<TSource>^ source, 
    Func<TSource, TKey>^ keySelector, 
    Func<TSource, TElement>^ elementSelector
)
static member ToDictionary : 
        source:IObservable<'TSource> * 
        keySelector:Func<'TSource, 'TKey> * 
        elementSelector:Func<'TSource, 'TElement> -> IObservable<IDictionary<'TKey, 'TElement>> 
JScript does not support generic types and methods.

型パラメーター

  • TSource
    ソースの種類。
  • TKey
    キーの種類。
  • TElement
    要素の型。

パラメーター

  • source
    種類: System.IObservable<TSource>
    ディクショナリを作成するための監視可能なシーケンス。
  • keySelector
    種類: System.Func<TSource、TKey>
    各要素からキーを抽出する関数。
  • elementSelector
    種類: System.Func<TSource、TElement>
    各要素から結果の要素値を生成する変換関数。

戻り値

種類: System.IObservable<IDictionary<TKey、TElement>>
指定したキー セレクター関数と要素セレクター関数に従った、監視可能なシーケンスからのディクショナリ。

使用上の注意

Visual Basic および C# では、 IObservable<TSource> 型の任意のオブジェクトでインスタンス メソッドとしてこのメソッドを呼び出すことができます。 インスタンス メソッド構文を使用してこのメソッドを呼び出す場合は、最初のパラメーターを省略します。 詳細については、」または」を参照してください。

参照

リファレンス

Observable クラス

ToDictionary オーバーロード

System.Reactive.Linq 名前空間