对可查询可观测序列中的最新值进行采样。
Namespace:System.Reactive.Linq
装配: system.Reactive.Providers 在 System.Reactive.Providers.dll) 中 (
语法
'Declaration
<ExtensionAttribute> _
Public Shared Function MostRecent(Of TSource) ( _
source As IQbservable(Of TSource), _
initialValue As TSource _
) As IQueryable(Of TSource)
'Usage
Dim source As IQbservable(Of TSource)
Dim initialValue As TSource
Dim returnValue As IQueryable(Of TSource)
returnValue = source.MostRecent(initialValue)
public static IQueryable<TSource> MostRecent<TSource>(
this IQbservable<TSource> source,
TSource initialValue
)
[ExtensionAttribute]
public:
generic<typename TSource>
static IQueryable<TSource>^ MostRecent(
IQbservable<TSource>^ source,
TSource initialValue
)
static member MostRecent :
source:IQbservable<'TSource> *
initialValue:'TSource -> IQueryable<'TSource>
JScript does not support generic types and methods.
类型参数
- TSource
源的类型。
参数
- source
类型: System.Reactive.Linq.IQbservable<TSource>
源可查询可观测序列。
- initialValue
类型:TSource
如果尚未采样任何元素,则由可枚举序列生成的初始值。
返回值
类型: System.Linq.IQueryable<TSource>
每次迭代时返回最后一个采样元素的可枚举序列。
使用说明
在 Visual Basic 和 C# 中,可以在 IQbservable<TSource> 类型的任何对象上调用此方法作为实例方法。 当使用实例方法语法调用此方法时,请省略第一个参数。 有关详细信息,请参阅或。