Beispiel #1
0
        private void HandleItemListener(IData itemData, Guid uuid, ItemEventType eventType, IItemListener <T> listener,
                                        bool includeValue)
        {
            var item = includeValue
                ? ToObject <T>(itemData)
                : default(T);
            var member    = Client.ClusterService.GetMember(uuid);
            var itemEvent = new ItemEvent <T>(Name, eventType, item, member);

            if (eventType == ItemEventType.Added)
            {
                listener.ItemAdded(itemEvent);
            }
            else
            {
                listener.ItemRemoved(itemEvent);
            }
        }
Beispiel #2
0
        protected void HandleItemListener(IData itemData, string uuid, ItemEventType eventType,
                                          IItemListener <T> listener, bool includeValue)
        {
            var item = includeValue
                ? ToObject <T>(itemData)
                : default(T);
            var member    = GetContext().GetClusterService().GetMember(uuid);
            var itemEvent = new ItemEvent <T>(GetName(), eventType, item, member);

            if (eventType == ItemEventType.Added)
            {
                listener.ItemAdded(itemEvent);
            }
            else
            {
                listener.ItemRemoved(itemEvent);
            }
        }