Observable.Subscribe<TSource> 方法 (IEnumerable<TSource>, IObserver<TSource>)
命名空間: Microsoft.Phone.Reactive
組件: Microsoft.Phone.Reactive (在 Microsoft.Phone.Reactive.dll 中)
語法
'宣告
<ExtensionAttribute> _
Public Shared Function Subscribe(Of TSource) ( _
source As IEnumerable(Of TSource), _
observer As IObserver(Of TSource) _
) As IDisposable
public static IDisposable Subscribe<TSource>(
this IEnumerable<TSource> source,
IObserver<TSource> observer
)
[ExtensionAttribute]
public:
generic<typename TSource>
static IDisposable^ Subscribe(
IEnumerable<TSource>^ source,
IObserver<TSource>^ observer
)
static member Subscribe :
source:IEnumerable<'TSource> *
observer:IObserver<'TSource> -> IDisposable
類型參數
- TSource
參數
- source
類型:System.Collections.Generic.IEnumerable<TSource>
- observer
類型:System.IObserver<TSource>
傳回值
使用注意事項
在 Visual Basic 和 C# 中,您可以在任何 IEnumerable<TSource> 類型物件中呼叫這個方法以做為執行個體。使用執行個體方法語法呼叫這個方法時,請省略第一個參數。如需詳細資訊,請參閱擴充方法 (Visual Basic)或擴充方法 (C# 程式設計手冊)。
版本資訊
適用於 Windows Phone 應用程式的 .NET
支援版本:Windows Phone 8、Silverlight 8.1
.NET Framework 安全性
- 完全信任立即呼叫者。這個成員無法供部分信任的程式碼使用。如需詳細資訊,請參閱從部分受信任程式碼使用程式庫。