Brunet.Messaging.SimpleSource.Unsubscribe C# (CSharp) Method

Unsubscribe() public method

Unsubscribes the the IDataHandler if it is the current IDatahandler.
public Unsubscribe ( IDataHandler hand ) : void
hand IDataHandler An IDataHandler that wishes to remove itself as a destination for data coming from this source.
return void
    public virtual void Unsubscribe(IDataHandler hand) {
      lock(_sync) {
        if( _sub.Handler == hand ) {
          _sub = null;
        }
        else {
          throw new Exception(String.Format("Handler: {0}, not subscribed", hand));
        }
      }
    }