Beispiel #1
0
            public void Dispose()
            {
                lock (gate)
                {
                    if (parent != null)
                    {
                        lock (parent.observerLock)
                        {
                            var listObserver = parent.outObserver as ListObserver <T>;
                            if (listObserver != null)
                            {
                                parent.outObserver = listObserver.Remove(unsubscribeTarget);
                            }
                            else
                            {
                                parent.outObserver = EmptyObserver <T> .Instance;
                            }

                            unsubscribeTarget = null;
                            parent            = null;
                        }
                    }
                }
            }
Beispiel #2
0
 public Subscription(AsyncSubject <T> parent, IObserver <T> unsubscribeTarget)
 {
     this.parent            = parent;
     this.unsubscribeTarget = unsubscribeTarget;
 }