共用方式為


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

參數

傳回值

類型:System.IDisposable

使用注意事項

在 Visual Basic 和 C# 中,您可以在任何 IEnumerable<TSource> 類型物件中呼叫這個方法以做為執行個體。使用執行個體方法語法呼叫這個方法時,請省略第一個參數。如需詳細資訊,請參閱擴充方法 (Visual Basic)擴充方法 (C# 程式設計手冊)

版本資訊

適用於 Windows Phone 應用程式的 .NET

支援版本:Windows Phone 8、Silverlight 8.1

.NET Framework 安全性

請參閱

參考

Observable 類別

Subscribe 多載

Microsoft.Phone.Reactive 命名空間