Observable.Using<TSource, TResource> Metodu
Bir kaynak nesnesine bağlı gözlemlenebilir bir dizi oluşturur.
Ad Alanı:System.Reactive.Linq
Derleme: System.Reactive (System.Reactive.dll içinde)
Syntax
'Declaration
Public Shared Function Using(Of TSource, TResource As IDisposable) ( _
resourceFactory As Func(Of TResource), _
observableFactory As Func(Of TResource, IObservable(Of TSource)) _
) As IObservable(Of TSource)
'Usage
Dim resourceFactory As Func(Of TResource)
Dim observableFactory As Func(Of TResource, IObservable(Of TSource))
Dim returnValue As IObservable(Of TSource)
returnValue = Observable.Using(resourceFactory, _
observableFactory)
public static IObservable<TSource> Using<TSource, TResource>(
Func<TResource> resourceFactory,
Func<TResource, IObservable<TSource>> observableFactory
)
where TResource : IDisposable
public:
generic<typename TSource, typename TResource>
where TResource : IDisposable
static IObservable<TSource>^ Using(
Func<TResource>^ resourceFactory,
Func<TResource, IObservable<TSource>^>^ observableFactory
)
static member Using :
resourceFactory:Func<'TResource> *
observableFactory:Func<'TResource, IObservable<'TSource>> -> IObservable<'TSource> when 'TResource : IDisposable
JScript does not support generic types and methods.
Tür Parametreleri
- Tsource
Kaynak türü.
- TResource
Kaynağın türü.
Parametreler
- resourceFactory
Tür: System.Func<TResource>
Kaynak nesnesi almak için fabrika işlevi.
- observableFactory
Tür: System.Func<TResource, IObservable<TSource>>
Elde edilen kaynağa bağlı gözlemlenebilir bir dizi elde etmek için fabrika işlevi.
Dönüş Değeri
Tür: System.IObservable<TSource>
Ömrü bağımlı kaynak nesnesinin ömrünü denetleyen gözlemlenebilir dizi.