示例#1
0
        void OnItemPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            CmdrIcon item = sender as CmdrIcon;

            if (item != null)
            {
                ModifiedItems.Add(item);
            }
        }
示例#2
0
        void OnItemPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            IOrderItem item = sender as IOrderItem;

            if (item != null)
            {
                ModifiedItems.Add(item);
            }
        }
示例#3
0
        public async Task OnPostUpdateAsync(PostUpdateEvent @event, CancellationToken cancellationToken)
        {
            if (isActive == false)
            {
                return;
            }

            var modifiedItems = await(@event.Persister.FindModifiedAsync(@event.OldState, @event.State, @event.Entity, @event.Session, cancellationToken));

            foreach (int index in modifiedItems)
            {
                ModifiedItems.Add(new Item
                {
                    Index    = index,
                    OldState = @event.OldState[index],
                    State    = @event.State[index]
                });
            }
        }
示例#4
0
        private void ItemObservableCollection_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
        {
            if (e.NewItems != null)
            {
                foreach (IOrderItem newItem in e.NewItems)
                {
                    ModifiedItems.Add(newItem);
                    //Add listener for each item on PropertyChanged event
                    newItem.PropertyChanged += this.OnItemPropertyChanged;
                }
            }

            if (e.OldItems != null)
            {
                foreach (IOrderItem oldItem in e.OldItems)
                {
                    ModifiedItems.Add(oldItem);

                    oldItem.PropertyChanged -= this.OnItemPropertyChanged;
                }
            }
        }
示例#5
0
        void CmdrIconsChanged(object sender, NotifyCollectionChangedEventArgs e)
        {
            if (e.NewItems != null)
            {
                foreach (CmdrIcon newItem in e.NewItems)
                {
                    ModifiedItems.Add(newItem);

                    //Add listener for each item on PropertyChanged event
                    newItem.PropertyChanged += this.OnItemPropertyChanged;
                }
            }

            if (e.OldItems != null)
            {
                foreach (CmdrIcon oldItem in e.OldItems)
                {
                    ModifiedItems.Add(oldItem);

                    oldItem.PropertyChanged -= this.OnItemPropertyChanged;
                }
            }
        }