/// <summary>
 /// Notifies peer about item exited area.
 /// </summary>
 public override void OnItemExit(Item item)
 {
     base.OnItemExit(item);
     var unsubscribeEvent = new ItemUnsubscribed { ItemId = item.Id, InterestAreaId = this.Id };
     var eventData = new EventData((byte)EventCode.ItemUnsubscribed, unsubscribeEvent);
     this.peer.SendEvent(eventData, new SendParameters { ChannelId = Settings.ItemEventChannel });
 }
        private OperationResponse ItemOperationUnsubscribeItem(Item item, UnsubscribeItem operation)
        {
            if (item.Disposed)
            {
                return operation.GetOperationResponse((int)ReturnCode.ItemNotFound, "ItemNotFound");
            }

            this.interestItems.UnsubscribeItem(item);

            var unsubscribeEvent = new ItemUnsubscribed { ItemId = item.Id };

            var eventData = new EventData((byte)EventCode.ItemUnsubscribed, unsubscribeEvent);
            this.Peer.SendEvent(eventData, new SendParameters { ChannelId = Settings.ItemEventChannel });

            // don't send response
            operation.OnComplete();
            return null;
        }