using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace System.Reactive.Subjects { /// /// Base calss for objects that are both an observable sequence as well as an observer. /// /// The type of the elements processed by the subject. public abstract class SubjectBase : ISubject, IDisposable { /// /// Indicates whether the subject has observers subscribed to it. /// public abstract bool HasObservers { get; } /// /// Indicates whether the subject has been disposed. /// public abstract bool IsDisposed { get; } /// /// Releases all resources used by the current instance of the subject and unsubscribes all observers. /// public abstract void Dispose(); /// /// Notifies all subscribed observers about the end of the sequence. /// public abstract void OnCompleted(); /// /// Notifies all subscribed observers about the specified exception. /// /// The exception to send to all currently subscribed observers. /// is null. public abstract void OnError(Exception error); /// /// Notifies all subscribed observers about the arrival of the specified element in the sequence. /// /// The value to send to all currently subscribed observers. public abstract void OnNext(T value); /// /// Subscribes an observer to the subject. /// /// Observer to subscribe to the subject. /// Disposable object that can be used to unsubscribe the observer from the subject. /// is null. public abstract IDisposable Subscribe(IObserver observer); } }