private void NotifyCollectionReset() { if (CollectionChanged != null) { CollectionChanged.Invoke(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset)); } }
private void NotifyItemAdded(int index, T item) { if (CollectionChanged != null) { CollectionChanged.Invoke(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, item, index)); } }
private void OnListChanged(NotifyCollectionChangedAction action) { if (CollectionChanged != null) { //TODO Allow different types CollectionChanged.Invoke(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset)); } }
private void NotifyItemRemoved(int index) { if (CollectionChanged != null) { CollectionChanged.Invoke(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, index)); } }
public void RemoveAll() { Clear(); if (CollectionChanged != null) { CollectionChanged.Invoke(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset)); } }
private void OnCollectionChanged(NotifyCollectionChangedEventArgs args) { if (CollectionChanged != null) { var N = CollectionChanged.GetInvocationList().Length; System.Diagnostics.Debug.WriteLine($"Number of items in event invocation list= {N}"); CollectionChanged.Invoke(this, args); } }
private void OnCollectionChanged(NotifyCollectionChangedEventArgs e) { if (IsNotifying && CollectionChanged != null) { CollectionChanged.Invoke(this, e); } OnPropertyChanged(); }
public void Clear() { if (CollectionChanged != null) { CollectionChanged.Invoke(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, m_Internal)); } m_Internal.Clear(); }
public void AddRange(TreeColumnCollection list) { this.InnerList.AddRange(list); if (CollectionChanged != null) { CollectionChanged.Invoke(this, new CollectionChangeEventArgs(CollectionChangeAction.Add, list)); } }
public void RemoveRange <TEntity>(List <TEntity> obj) where TEntity : class { Set <TEntity>().RemoveRange(obj); SaveChanges(); if (CollectionChanged is not null) { CollectionChanged.Invoke(this, new EventArgs()); } }
public void Remove(TreeColumn treeColumn) { this.List.Remove(treeColumn); if (CollectionChanged != null) { CollectionChanged.Invoke(this, new CollectionChangeEventArgs(CollectionChangeAction.Remove, treeColumn)); } }
private void NotifyCollectionChanged(FRAFile file, FRAFileChange change) { FRAFileEventArgs eventArgs = new FRAFileEventArgs(file, change); if (CollectionChanged != null) { CollectionChanged.Invoke(this, eventArgs); } }
protected void OnCollectionChanged(NotifyCollectionChangedEventArgs e) { if (IsNotifying && CollectionChanged != null) { CollectionChanged.Invoke(this, e); } // notify count changed OnPropertyChanged(CountString); }
public async Task UpdateRangeAsync <TEntity>(List <TEntity> obj) where TEntity : class { Set <TEntity>().UpdateRange(obj); await SaveChangesAsync(); if (CollectionChanged is not null) { CollectionChanged.Invoke(this, new EventArgs()); } }
protected override void OnCollectionChanged(NotifyCollectionChangedEventArgs e) { base.OnCollectionChanged(e); var eh = CollectionChanged; if (eh != null) { using (BlockReentrancy()) CollectionChanged.Invoke(this, e); } }
protected internal void RemoveFile(IDownloadFile file) { lock (_queue) { _queue.Remove(file); } if (CollectionChanged != null) { CollectionChanged.Invoke(Queue, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, file)); } }
protected override void OnCollectionChanged(NotifyCollectionChangedEventArgs e) { if (!_SuppressCollectionChanged) { base.OnCollectionChanged(e); if (CollectionChanged != null) { CollectionChanged.Invoke(this, e); } } }
public void Insert(int index, T item) { ThrowIfInHandler(); try { InHandler = true; Items.Insert(index, item); CollectionChanged.Invoke(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, item, index)); } finally { InHandler = false; } }
public void Add(T item) { ThrowIfInHandler(); try { InHandler = true; Items.Add(item); CollectionChanged.Invoke(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, item, Count - 1)); } finally { InHandler = false; } }
public void Reset() { #if !SILVERLIGHT if (changeNotificationsSuppressed == 0 && CollectionChanged != null) { CollectionChanged.Invoke(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset)); } #else // XXX: SL4 and WP7 hate on this #endif }
// Movie that user would like to have removed from their preferences. public bool RemoveIfPresent(Movie movie) { var eventArgs = new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, movie); if (movies.Remove(movie)) { CollectionChanged.Invoke(this, eventArgs); return(true); } return(false); }
public override EntityEntry <TEntity> Remove <TEntity>(TEntity obj) where TEntity : class { var value = Set <TEntity>().Remove(obj); SaveChanges(); if (CollectionChanged is not null) { CollectionChanged.Invoke(this, new EventArgs()); } return(value); }
public void Insert(int index, int item) { m_Internal.Insert(index, item); if (CollectionChanged != null) { CollectionChanged.Invoke(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, new List <int>() { item })); } }
public override EntityEntry <TEntity> Update <TEntity>(TEntity obj) where TEntity : class { var result = Set <TEntity>().Update(obj); SaveChanges(); if (CollectionChanged is not null) { CollectionChanged.Invoke(this, new EventArgs()); } return(result); }
protected override void OnCollectionChanged(NotifyCollectionChangedEventArgs e) { if (suppressNotification) { return; } base.OnCollectionChanged(e); if (CollectionChanged != null) { CollectionChanged.Invoke(this, e); } }
public async Task <EntityEntry <TEntity> > RemoveAsync <TEntity>(TEntity obj) where TEntity : class { var value = Set <TEntity>().Remove(obj); await SaveChangesAsync(); if (CollectionChanged is not null) { CollectionChanged.Invoke(this, new EventArgs()); } return(value); }
public void AddValue(Int32 id, Object value) { AdapterItem ai = new AdapterItem(); ai.id = id; ai.data = value; values.Add(ai); if (CollectionChanged != null) { CollectionChanged.Invoke(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, value, id)); } }
public async Task <EntityEntry <TEntity> > UpdateAsync <TEntity>(TEntity obj) where TEntity : class { var result = Set <TEntity>().Update(obj); await SaveChangesAsync(); if (CollectionChanged is not null) { CollectionChanged.Invoke(this, new EventArgs()); } return(result); }
public void RemoveAt(int index) { ThrowIfInHandler(); try { InHandler = true; var oldItem = this [index]; Items.Remove(oldItem); CollectionChanged.Invoke(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, oldItem, index)); } finally { InHandler = false; } }
public void Clear() { ThrowIfInHandler(); try { InHandler = true; //Mono.NativeMethods.collection_clear (native); Items.Clear(); CollectionChanged.Invoke(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset)); } finally { InHandler = false; } }