Пример #1
0
        private void SetDelegateView(ICollectionView collectionView)
        {
            if (delegateView == collectionView)
            {
                return;
            }

            IEnumerable <object> oldItems;

            if (delegateView != null)
            {
                delegateView.CollectionChanged -= OnDelegateViewCollectionChanged;
                delegateView.CurrentChanged    -= OnDelegateViewCurrentChanged;
                oldItems = delegateView.Cast <object>();
            }
            else
            {
                oldItems = new object[0];
            }

            delegateView = collectionView ?? CollectionView.Empty;

            delegateView.CollectionChanged += OnDelegateViewCollectionChanged;
            delegateView.CurrentChanged    += OnDelegateViewCurrentChanged;

            CollectionChanged.Raise(this, NotifyCollectionChangedEventArgs.Reset(oldItems, delegateView.Cast <object>()));
            CurrentChanged.Raise(this);
        }
Пример #2
0
        private void SetCurrent(object item, int itemIndex)
        {
            if (this.currentItem == item && this.currentItemIndex == itemIndex)
            {
                return;
            }

            this.currentItem      = item;
            this.currentItemIndex = itemIndex;

            CurrentChanged.Raise(this);
        }
Пример #3
0
        private void bindingSource_CurrentChanged(object sender, EventArgs e)
        {
            if (_isProgrammFocus)
            {
                return;
            }
            var processObject = bindingSource.Current as ProcessObject;

            if (processObject != null)
            {
                CurrentChanged.Raise(this, processObject);
            }
            //OnCurrentChanged(new EventArgs<ProcessObject>(processObject));
        }
Пример #4
0
 public void OnDelegateViewCurrentChanged(object sender, EventArgs e)
 {
     CurrentChanged.Raise(this, e);
 }