/// <summary>
        ///   The on subscribed item disposed.
        /// </summary>
        /// <param name = "itemDisposeMessage">
        ///   The item dispose message.
        /// </param>
        private void SubscribedItem_OnItemDisposed(ItemDisposedMessage itemDisposeMessage)
        {
            MessageCounters.CounterReceive.Increment();

            // interest areas have to be locked
            lock (this.SyncRoot)
            {
                this.UnsubscribeItem(itemDisposeMessage.Source);
            }
        }
        /// <summary>
        ///   The attached item disposed.
        /// </summary>
        /// <param name = "message">
        ///   The message.
        /// </param>
        private void AttachedItem_OnItemDisposed(ItemDisposedMessage message)
        {
            MessageCounters.CounterReceive.Increment();

            lock (this.SyncRoot)
            {
                if (message.Source == this.AttachedItem)
                {
                    this.Detach();
                }
            }
        }
        /// <summary>
        ///   The on auto subscribed item disposed.
        /// </summary>
        /// <param name = "message">
        ///   The message.
        /// </param>
        private void AutoSubscribedItem_OnItemDisposed(ItemDisposedMessage message)
        {
            MessageCounters.CounterReceive.Increment();

            lock (this.SyncRoot)
            {
                ItemAutoSubscription subscription;
                if (this.autoManagedItemSubscriptions.TryGetValue(message.Source, out subscription))
                {
                    this.AutoUnsubscribeItem(subscription);
                }
            }
        }
Esempio n. 4
0
        /// <summary>
        /// The remove item.
        /// </summary>
        /// <param name="message">
        /// The message.
        /// </param>
        private void RemoveItem(ItemDisposedMessage message)
        {
            ////log.InfoFormat("remove item {0}", message.Source.Id);
            Item item = message.Source;
            this.itemPositions.Remove(item);
            this.itemSubscriptions[item].Dispose();
            this.itemSubscriptions.Remove(item);

            this.PublishUpdate(item, null, false);
        }