//------------------------------------------------------ // // Constructors // //------------------------------------------------------ /// <summary> /// Construct a NotifyCollectionChangedEventArgs that describes a reset change. /// </summary> /// <param name="action">The action that caused the event (must be Reset).</param> public NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction action) { if (action != NotifyCollectionChangedAction.Reset) throw new ArgumentException("This constructor can only be used with the Reset action.", "action"); InitializeAdd(action, null, -1); }
/// <summary> /// Construct a NotifyCollectionChangedEventArgs that describes a reset change. /// </summary> /// <param name="action">The action that caused the event (must be Reset). public NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction action) { if (action != NotifyCollectionChangedAction.Reset) throw new ArgumentException("WrongActionForCtor, NotifyCollectionChangedAction.Reset", "action"); InitializeAdd(action, null, -1); }
public NotifyCollectionChangedEventArgs (NotifyCollectionChangedAction action) { this.action = action; if (action != NotifyCollectionChangedAction.Reset) throw new ArgumentException ("This constructor can only be used with the Reset action.", "action"); }
internal DictionaryChangedEventArgs(NotifyCollectionChangedAction action, string key, object oldValue, object newValue) { this.Action = action; this.Key = key; this.OldValue = oldValue; this.NewValue = newValue; }
public NotifyCollectionChangedEventArgs (NotifyCollectionChangedAction action, IList changedItems, int startingIndex) { this.action = action; if (action == NotifyCollectionChangedAction.Add || action == NotifyCollectionChangedAction.Remove) { if (changedItems == null) throw new ArgumentNullException ("changedItems"); if (startingIndex < -1) throw new ArgumentException ("The value of startingIndex must be -1 or greater.", "startingIndex"); if (action == NotifyCollectionChangedAction.Add) InitializeAdd (changedItems, startingIndex); else InitializeRemove (changedItems, startingIndex); } else if (action == NotifyCollectionChangedAction.Reset) { if (changedItems != null) throw new ArgumentException ("This constructor can only be used with the Reset action if changedItems is null", "changedItems"); if (startingIndex != -1) throw new ArgumentException ("This constructor can only be used with the Reset action if startingIndex is -1", "startingIndex"); } else { throw new ArgumentException ("This constructor can only be used with the Reset, Add, or Remove actions.", "action"); } }
/// <summary> /// Construct a NotifyCollectionChangedEventArgs that describes a one-item change. /// </summary> /// <param name="action">The action that caused the event.</param> /// <param name="changedItem">The item affected by the change.</param> /// <param name="index">The index where the change occurred.</param> public NotifyCollectionChangedEventArgs( NotifyCollectionChangedAction action, object changedItem, int index) : this(action, changedItem == null? null: new[]{ changedItem }, index) { }
public NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction action, IList newItems, IList oldItems, int startingIndex) { this.Action = action; this.NewItems = newItems; this.OldItems = oldItems; this.NewStartingIndex = startingIndex; }
private CollectionChangedActionItem(IList list, NotifyCollectionChangedAction actionToUndo) { if (list == null) throw new ArgumentNullException("list"); if (actionToUndo == NotifyCollectionChangedAction.Reset) throw new ArgumentException("Reset is not supported by the undo stack."); this.list = list; this.actionToUndo = actionToUndo; }
public ControllerCollectionChangedEventArgs(Entity entity, AudioEmitterSoundController controller, AudioEmitterComponent component, NotifyCollectionChangedAction action) { Entity = entity; Controller = controller; EmitterComponent = component; Action = action; }
//------------------------------------------------------ // // Constructors // //------------------------------------------------------ /// <summary> /// Construct a NotifyCollectionChangedEventArgs that describes a reset change. /// </summary> /// <param name="action">The action that caused the event (must be Reset).</param> public NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction action) { if (action != NotifyCollectionChangedAction.Reset) throw new ArgumentException(SR.Format(SR.WrongActionForCtor, NotifyCollectionChangedAction.Reset), nameof(action)); InitializeAdd(action, null, -1); }
public CollectionChangedActionItem(IList list, NotifyCollectionChangedAction actionToUndo, IReadOnlyCollection<object> items, int index) : this(list, actionToUndo) { if (items == null) throw new ArgumentNullException("items"); this.items = items; this.index = index; }
public NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction action, IList changedItems) { this._newStartingIndex = -1; this._oldStartingIndex = -1; if (((action != NotifyCollectionChangedAction.Add) && (action != NotifyCollectionChangedAction.Remove)) && (action != NotifyCollectionChangedAction.Reset)) { throw new ArgumentException("Must Be Reset Add Or Remove Action For Ctor", "action"); } if (action == NotifyCollectionChangedAction.Reset) { if (changedItems != null) { throw new ArgumentException("Reset Action Requires Null Item", "action"); } this.InitializeAdd(action, null, -1); } else { if (changedItems == null) { throw new ArgumentNullException("changed Items"); } this.InitializeAddOrRemove(action, changedItems, -1); } }
public NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction action, IList changedItems, int index, int oldIndex) { this.Action = action; this.NewItems = changedItems; this.NewStartingIndex = index; this.OldStartingIndex = oldIndex; }
public NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction action, object changedItem, int index) { IList changedItems = new[] { changedItem }; _action = action; if (action == NotifyCollectionChangedAction.Add) { InitializeAdd(changedItems, index); } else if (action == NotifyCollectionChangedAction.Remove) { InitializeRemove(changedItems, index); } else if (action == NotifyCollectionChangedAction.Reset) { if (changedItem != null) { throw new ArgumentException("This constructor can only be used with the Reset action if changedItem is null", "changedItem"); } if (index != -1) { throw new ArgumentException("This constructor can only be used with the Reset action if index is -1", "index"); } } else { throw new ArgumentException("This constructor can only be used with the Reset, Add, or Remove actions.", "action"); } }
public CollectionChangeOperation(IList list, NotifyCollectionChangedAction actionToUndo, IReadOnlyCollection<object> items, int index, IEnumerable<IDirtiable> dirtiables) : this(list, actionToUndo, dirtiables) { if (items == null) throw new ArgumentNullException(nameof(items)); this.items = items; this.index = index; }
internal ItemsChangedEventArgs(NotifyCollectionChangedAction action, GeneratorPosition position, int itemCount, int itemUICount) : this(action, position, new GeneratorPosition(-1, 0), itemCount, itemUICount) { }
public TrackingCollectionChangedEventArgs(NotifyCollectionChangedAction action, object item, object oldItem, int index = -1, bool collectionChanged = false) { Action = action; Item = item; OldItem = oldItem; Index = index; CollectionChanged = collectionChanged; }
internal ItemsChangedEventArgs (NotifyCollectionChangedAction action, int itemCount, int itemUICount, GeneratorPosition oldPosition, GeneratorPosition position) { this.action = action; item_count = itemCount; item_ui_count = itemUICount; old_position = oldPosition; this.position = position; }
public AttributeEventArgs(Attribute _attribute, AttributeValue _newValue, AttributeValue _oldValue, NotifyCollectionChangedAction _action) : base() { this.attribute = _attribute; this.newValue = _newValue; this.oldValue = _oldValue; this.action = _action; }
private CollectionChangeOperation(IList list, NotifyCollectionChangedAction actionToUndo, IEnumerable<IDirtiable> dirtiables) : base(dirtiables) { if (list == null) throw new ArgumentNullException(nameof(list)); if (actionToUndo == NotifyCollectionChangedAction.Reset) throw new ArgumentException("Reset is not supported by the undo stack."); ActionToUndo = actionToUndo; this.list = list; }
private NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction action, IEnumerable<object> oldItems, int oldStartingIndex, IEnumerable<object> newItems, int newStartingIndex) { this.Action = action; this.OldItems = oldItems; this.OldStartingIndex = oldStartingIndex; this.NewItems = newItems; this.NewStartingIndex = newStartingIndex; }
public MappingsEventArgs(NotifyCollectionChangedAction action, List<IMappingsConfiguration> added, List<IMappingsConfiguration> removed) { this.Action = action; this.AddedItems = added; this.RemovedItems = removed; }
public NotifyCollectionChangedEventArgs (NotifyCollectionChangedAction action, int newStartingIndex, int oldStartingIndex, IList newItems, IList oldItems) { Action = action; NewStartingIndex = newStartingIndex; OldStartingIndex = oldStartingIndex; NewItems = newItems; OldItems = oldItems; }
public NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction action, object item, int index, int oldIndex) { Action = action; Item = item; Index = index; Length = 1; OldIndex = oldIndex; }
public void RaiseCollectionChanged(NotifyCollectionChangedAction action,object item) { var handler = CollectionChanged; if (handler != null) { handler(this,new NotifyCollectionChangedEventArgs(action,item)); } }
public NotifyCollectionChangedEventArgs (NotifyCollectionChangedAction action) { if (action != NotifyCollectionChangedAction.Reset) throw new NotSupportedException (); Action = action; NewStartingIndex = -1; OldStartingIndex = -1; }
public MultiDimensionalArrayChangedEventArgs(NotifyCollectionChangedAction action, object item, int index, int oldIndex, int[] stride) { Stride = stride; // TODO: maybe we should clone it here, will be slow Action = action; Item = item; Index = index; Length = 1; OldIndex = oldIndex; }
/// <summary> /// Initializes a new instance of the <see cref="NotifyRangedCollectionChangedEventArgs"/> class. /// </summary> /// <param name="action">The action.</param> /// <param name="changedItems">The changed items.</param> /// <param name="indices">The indices.</param> public NotifyRangedCollectionChangedEventArgs(NotifyCollectionChangedAction action, IList changedItems, IList<int> indices) : base(action, changedItems, (indices != null && indices.Count != 0) ? indices[0] : -1) { Argument.IsNotNull("indices", indices); // ReSharper disable once PossibleNullReferenceException Argument.IsNotOutOfRange("indices", indices.Count, changedItems.Count, changedItems.Count); Indices = indices; }
public TrackingCollectionChangedEventArgs(NotifyCollectionChangedAction action, object key, object item, object oldItem, bool collectionChanged = false) { Action = action; Item = item; OldItem = oldItem; Key = key; Index = -1; CollectionChanged = collectionChanged; }
public NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction action) { this._newStartingIndex = -1; this._oldStartingIndex = -1; if (action != NotifyCollectionChangedAction.Reset) { throw new ArgumentException("Wrong Action For Ctor", "action"); } this.InitializeAdd(action, null, -1); }
public static CollectionChange <OldItemType, NewItemType> CreateOld(NotifyCollectionChangedAction changeAction, [AllowNull] OldItemType oldItem, int oldIndex) { var oldItems = new OldItemType[] { oldItem ! }; return(CreateOld(changeAction, oldItems, oldIndex)); }
public CollectionChangeEventArgs(NotifyCollectionChangedAction action, T changedItem) : base(action, changedItem) { }
public CollectionChangeEventArgs(NotifyCollectionChangedAction action) : base(action) { }
public CollectionChangeEventArgs(NotifyCollectionChangedAction action, IList <T> newItems, IList <T> oldItems, int startingIndex) : base(action, (IList)newItems, (IList)oldItems, startingIndex) { }
public CollectionChangeEventArgs(NotifyCollectionChangedAction action, T newItem, T oldItem, int index) : base(action, newItem, oldItem, index) { }
internal TradeEntry(NotifyCollectionChangedAction action, InstrumentViewModel instrument, BitMexTrade trade) { Action = action; Instrument = instrument; Trade = trade; }
public CollectionChangeEventArgs(NotifyCollectionChangedAction action, IList <T> changedItems, int index, int oldIndex) : base(action, (IList)changedItems, index, oldIndex) { }
private void InitializeMoveOrReplace(NotifyCollectionChangedAction action, IList newItems, IList oldItems, int startingIndex, int oldStartingIndex) { InitializeAdd(action, newItems, startingIndex); InitializeRemove(action, oldItems, oldStartingIndex); }
private void InitializeRemove(NotifyCollectionChangedAction action, IList oldItems, int oldStartingIndex) { Action = action; OldItems = (oldItems == null) ? null : ArrayList.ReadOnly(oldItems); OldStartingIndex = oldStartingIndex; }
private void OnCollectionChanged(NotifyCollectionChangedAction action, object oldItem, object newItem, int index) { OnCollectionChanged(new NotifyCollectionChangedEventArgs(action, newItem, oldItem, index)); }
/// <summary> /// Notify the owning DataGrid of changes to this collection. /// </summary> protected override void OnCollectionChanged(NotifyCollectionChangedAction action, VirtualizedCellInfoCollection oldItems, VirtualizedCellInfoCollection newItems) { Owner.OnSelectedCellsChanged(action, oldItems, newItems); }
private void OnCollectionChanged(NotifyCollectionChangedAction action, object item) => OnCollectionChanged(new NotifyCollectionChangedEventArgs(action, item));
private void OnCollectionChanged(NotifyCollectionChangedAction action, object changedItem) { OnCollectionChanged(new NotifyCollectionChangedEventArgs(action, changedItem)); }
public FileListPaneViewModelItemsChangedEventArgs(NotifyCollectionChangedAction action, IList changedItems, int startingIndex, object sender) : base(action, changedItems, startingIndex) { Sender = sender; }
public static CollectionChange <OldItemType, NewItemType> CreateOld(NotifyCollectionChangedAction changeAction, IReadOnlyList <OldItemType>?oldItems, int oldIndex) => new CollectionChange <OldItemType, NewItemType>(changeAction, oldItems, oldIndex, null, -1);
private void InitializeAdd(NotifyCollectionChangedAction action, IList newItems, int newStartingIndex) { Action = action; NewItems = (newItems == null) ? null : ArrayList.ReadOnly(newItems); NewStartingIndex = newStartingIndex; }
protected void OnCollectionChanged(NotifyCollectionChangedAction action, PeopleUser item) { CollectionChanged?.Invoke(this, new NotifyCollectionChangedEventArgs(action, item)); }
public CollectionChange(NotifyCollectionChangedAction changeAction, [AllowNull] OldItemType oldItem, int oldIndex, [AllowNull] NewItemType newItem, int newIndex) : this(changeAction, new OldItemType[] { oldItem ! }, oldIndex, new NewItemType[] { newItem ! }, newIndex)
public static void Raise(this NotifyCollectionChangedEventHandler @event, object sender, NotifyCollectionChangedAction action) { if (@event != null) { @event(sender, new NotifyCollectionChangedEventArgs(action)); } }
public CollectionChange(NotifyCollectionChangedAction changeAction, IReadOnlyList <OldItemType> oldValues, int oldIndex, NewItemType newItem, int newIndex) : this(changeAction, oldValues, oldIndex, new NewItemType[] { newItem }, newIndex) { }
public CollectionChangeEventArgs(NotifyCollectionChangedAction action, T changedItem, int index, int oldIndex) : base(action, changedItem, index, oldIndex) { }
public CollectionChange(NotifyCollectionChangedAction changeAction, IReadOnlyList <OldItemType>?oldItems, int oldIndex, IReadOnlyList <NewItemType>?newItems, int newIndex) { Action = changeAction; oldPartialCollectionChange = new PartialCollectionChange <OldItemType>(PartialCollectionChangeItemState.OldItem, oldItems, oldIndex); newPartialCollectionChange = new PartialCollectionChange <NewItemType>(PartialCollectionChangeItemState.NewItem, newItems, newIndex); }
public CollectionChangeEventArgs(NotifyCollectionChangedAction action, IList <T> newItems, IList <T> oldItems) : base(action, (IList)newItems, (IList)oldItems) { }
public static CollectionChange <OldItemType, NewItemType> CreateNew(NotifyCollectionChangedAction changeAction, [AllowNull] NewItemType newItem, int newIndex) { var newItems = new NewItemType[] { newItem ! }; return(CreateNew(changeAction, newItems, newIndex)); }
public CollectionChangeEventArgs(NotifyCollectionChangedAction action, IList <T> changedItems) : base(action, (IList)changedItems) { }
public static CollectionChange <OldItemType, NewItemType> CreateNew(NotifyCollectionChangedAction changeAction, IReadOnlyList <NewItemType>?newValues, int newIndex) => new CollectionChange <OldItemType, NewItemType>(changeAction, null, -1, newValues, newIndex);
public NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction action, object changedItem) : this(action, changedItem, -1) { }
public FileListPaneViewModelItemsChangedEventArgs(NotifyCollectionChangedAction action, object newItem, object oldItem, object sender) : base(action, newItem, oldItem) { Sender = sender; }
public NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction action, IList changedItems) : this(action, changedItems, -1) { }
public NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction action, IList newItems, IList oldItems) : this(action, newItems, oldItems, -1) { }