Observable.Using<TSource, TResource> Method

March 22, 2012

Retrieves resource from resourceSelector for use in resourceUsage and disposes the resource once the resulting observable sequence terminates.

Namespace:  Microsoft.Phone.Reactive
Assembly:  Microsoft.Phone.Reactive (in Microsoft.Phone.Reactive.dll)

public static IObservable<TSource> Using<TSource, TResource>(
	Func<TResource> resourceSelector,
	Func<TResource, IObservable<TSource>> resourceUsage
)
where TResource : IDisposable

Type Parameters

TSource
TResource

Parameters

resourceSelector
Type: System.Func<TResource>
resourceUsage
Type: System.Func<TResource, IObservable<TSource>>

Return Value

Type: System.IObservable<TSource>
Returns IObservable<T>.

Windows Phone OS

Supported in: 7.1, 7.0

Windows Phone

Show: