public CollectionChangedEventArgs(RoutedEvent routedEvent, UndoAction undoAction, CollectionChangedAction collectionChangedAction)
     : base(routedEvent)
 {
     // Initialize the object
     this.undoAction = undoAction;
     this.collectionChangedAction = collectionChangedAction;
 }
        public CollectionChangedEventArgs(RoutedEvent routedEvent, UndoAction undoAction,
                                          CollectionChangedAction collectionChangedAction, object newItem, object oldItem, int newIndex)
            : base(routedEvent)
        {
            // Initialize the object
            this.undoAction = undoAction;
            this.collectionChangedAction = collectionChangedAction;

            ArrayList newItems = new ArrayList();

            newItems.Add(newItem);

            ArrayList oldItems = new ArrayList();

            oldItems.Add(oldItem);

            switch (this.collectionChangedAction)
            {
            case CollectionChangedAction.Replace:

                this.newItems         = newItems;
                this.oldItems         = oldItems;
                this.newStartingIndex = newIndex;
                break;
            }
        }
 void DoChange(CollectionChangedAction e, int newIndex, int oldIndex)
 {
     if (CollectionChanged != null && newIndex == _intIndex)
     {
         CollectionChanged(this, new CollectionChangedEventArgs(e, newIndex, oldIndex));
     }
 }
Exemple #4
0
 public CollectionChangedEventArgs(string collection, ICollection list, CollectionChangedAction action, object newItem, object oldItem, int index) : base(collection)
 {
     Action  = action;
     NewItem = newItem;
     OldItem = oldItem;
     Index   = index;
 }
Exemple #5
0
 private void DoChanged(CollectionChangedAction action, int newIndex, int oldIndex)
 {
     if (CollectionChanged != null)
     {
         CollectionChanged(this, new CollectionChangedEventArgs(action, newIndex, oldIndex));
     }
 }
Exemple #6
0
 private void FireExtensionsChanged(string extensionPoint, CollectionChangedAction action, List <Extension> extensions)
 {
     foreach (Extension extension in extensions)
     {
         this.FireExtensionChanged(extensionPoint, action, extension);
     }
 }
        public CollectionChangedEventArgs(RoutedEvent routedEvent, UndoAction undoAction, CollectionChangedAction collectionChangedAction, object item, int index)
            : base(routedEvent)
        {
            // Initialize the object
            this.undoAction = undoAction;
            this.collectionChangedAction = collectionChangedAction;

            ArrayList items = new ArrayList();

            items.Add(item);

            switch (this.collectionChangedAction)
            {
            case CollectionChangedAction.Add:

                this.newStartingIndex = index;
                this.newItems         = items;
                break;

            case CollectionChangedAction.Remove:

                this.oldStartingIndex = index;
                this.oldItems         = items;
                break;
            }
        }
 public CollectionChangedEventData(CollectionChangedAction action
                                   , IList <T> newItems = null
                                   , IList <T> oldItems = null)
 {
     this.Action   = action;
     this.NewItems = newItems;
     this.OldItems = OldItems;
 }
Exemple #9
0
 public CollectionChangedEventArgs(string collection, CollectionChangedAction action) : base(collection)
 {
     if (action != CollectionChangedAction.Clear)
     {
         throw new Exception("传入了空的参数,但执行的不是清空集合的操作");
     }
     Action = action;
 }
Exemple #10
0
        private void FireExtensionPointChanged(CollectionChangedAction action, ExtensionPoint extensionPoint)
        {
            ExtensionPointEventArgs args = new ExtensionPointEventArgs(this, action)
            {
                ExtensionPoint = extensionPoint
            };

            this.OnExtensionPointChanged(args);
        }
Exemple #11
0
        private void FireExtensionChanged(string extensionPoint, CollectionChangedAction action, Extension extension)
        {
            ExtensionEventArgs args = new ExtensionEventArgs(extensionPoint, this, action)
            {
                Extension = extension
            };

            this.OnExtensionChanged(args);
        }
Exemple #12
0
        private void PublishContactListChanged(CollectionChangedAction action, string address = "")
        {
            Contact item = null;

            if (!String.IsNullOrEmpty(address))
            {
                item = this[address];
            }

            this.contactListChanged.OnNext(new CollectionChangedEventData <Contact>(action, item));
        }
        private void RaiseCollectionChanged(CollectionChangedAction action, object oldItem, object newItem, int index)
        {
            if (CollectionChanged == null)
            {
                return;
            }

            switch (action)
            {
            case CollectionChangedAction.Replaced:
                CollectionChanged(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Replace, newItem, oldItem, index));
                break;
            }
        }
        /// <summary>
        /// Common Method which raise collection chaged
        /// </summary>
        /// <param name="action">CollectionChangedAction</param>
        private void RaiseCollectionChanged(CollectionChangedAction action)
        {
            if (CollectionChanged == null)
            {
                return;
            }

            switch (action)
            {
            case CollectionChangedAction.Changed:
            case CollectionChangedAction.Reset:
                CollectionChanged(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
                break;
            }
        }
        public CollectionChangedEventData(CollectionChangedAction action, T item)
        {
            this.Action = action;

            if (action == CollectionChangedAction.Add)
            {
                this.NewItems = new List <T> {
                    item
                };
            }
            else if (action != CollectionChangedAction.Reset)
            {
                this.OldItems = new List <T> {
                    item
                };
            }
        }
        public CollectionChangedEventArgs(RoutedEvent routedEvent, UndoAction undoAction,
                                          CollectionChangedAction collectionChangedAction, IList newItems, IList oldItems)
            : base(routedEvent)
        {
            // Initialize the object
            this.undoAction = undoAction;
            this.collectionChangedAction = collectionChangedAction;

            switch (this.collectionChangedAction)
            {
            case CollectionChangedAction.Replace:

                this.newItems = newItems;
                this.oldItems = oldItems;
                break;
            }
        }
        private void RaiseCollectionChanged(CollectionChangedAction action, object item, int index)
        {
            if (CollectionChanged == null)
            {
                return;
            }

            switch (action)
            {
            case CollectionChangedAction.Added:
                CollectionChanged(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, item, index));
                break;

            case CollectionChangedAction.Removed:
                CollectionChanged(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, item, index));
                break;
            }
        }
Exemple #18
0
 public CollectionChangedEventArgs(string collection, ICollection list, CollectionChangedAction action, object item, int index) : base(collection)
 {
     if (action == CollectionChangedAction.Add)
     {
         Action  = action;
         Index   = index;
         NewItem = item;
     }
     else if (action != CollectionChangedAction.Remove)
     {
         Action  = action;
         Index   = index;
         OldItem = item;
     }
     else
     {
         throw new Exception("使用了Add或Remove的事件参数,执行的不是Add或Remove方法");
     }
 }
Exemple #19
0
 public ExtensionEventArgs(IExtension extension, CollectionChangedAction action)
 {
     this.extension = extension;
     this.action    = action;
 }
Exemple #20
0
 internal ExtensionPointEventArgs(IExtensionManager extensionManager, CollectionChangedAction action)
 {
     ExtensionManager = extensionManager;
     Action           = action;
 }
Exemple #21
0
 public ExtensionPointEventArgs(IExtensionPoint extensionPoint, CollectionChangedAction action)
 {
     this.extensionPoint = extensionPoint;
     this.action         = action;
 }
Exemple #22
0
 public CollectionChangedEventArgs(CollectionChangedAction action, int newindex, int oldindex)
 {
     _Action   = action;
     _NewIndex = newindex;
     _OldIndex = oldindex;
 }
Exemple #23
0
 internal ExtensionEventArgs(string extensionPoint, IExtensionManager extensionManager, CollectionChangedAction action)
 {
     ExtensionPoint   = extensionPoint;
     ExtensionManager = extensionManager;
     Action           = action;
 }