internal void ReportGroupsUpdated(IList <IGroup> updatedGroups) { var args = new GroupsChangedArgs(); args.Updated.AddRange(updatedGroups); this.FireGroupsChanged(args); }
internal void EndDelayedUpdate() { this.FireGroupsChangedEvent(this.groups); this.groups = null; this.FireFavoritesChangedEvent(this.favorites); this.favorites = null; }
internal void ReportGroupsDeleted(List <IGroup> deletedGroups) { var args = new GroupsChangedArgs(); args.Removed.AddRange(deletedGroups); this.FireGroupsChanged(args); }
internal void ReportGroupsAdded(List <IGroup> addedGroups) { var args = new GroupsChangedArgs(); args.Added.AddRange(addedGroups); this.FireGroupsChanged(args); }
internal void StartDelayedUpdate() { if (this.DelayedUpdate) { return; } this.groups = new GroupsChangedArgs(); this.favorites = new FavoritesChangedEventArgs(); }
private void FireGroupsChanged(GroupsChangedArgs args) { if (args.IsEmpty) { return; } this.DeliverGroupsChanges(args); }
internal void AddFrom(GroupsChangedArgs source) { var toAdd = ListsHelper.GetMissingSourcesInTarget(source.Added, this.Added); this.Added.AddRange(toAdd); var toUpdate = ListsHelper.GetMissingSourcesInTarget(source.Updated, this.Updated); this.Updated.AddRange(toUpdate); var toRemove = ListsHelper.GetMissingSourcesInTarget(source.Removed, this.Removed); this.Removed.AddRange(toRemove); }
private void Dispatcher_GroupsChanged(GroupsChangedArgs args) { if (args.Added.Count == 1) this.AddedReported++; if (args.Removed.Count == 1) this.RemovedReported++; if (args.Updated.Count == 1) this.UpdateReported++; }
private void DeliverGroupsChanges(GroupsChangedArgs args) { if (this.DelayedUpdate) { this.groups.AddFrom(args); } else { this.FireGroupsChangedEvent(args); } }
private void FireGroupsChangedEvent(GroupsChangedArgs args) { // prevent persistence dummy call without start update if (args == null) { return; } Debug.WriteLine(args.ToString()); this.GroupsChanged?.Invoke(args); }
internal void ReportGroupsRecreated(List <IGroup> addedGroups, List <IGroup> deletedGroups) { var args = new GroupsChangedArgs(addedGroups, deletedGroups); this.FireGroupsChanged(args); }
private void DispatcherGroupsChanged(GroupsChangedArgs args) { if (args.Added.Count == 1) this.addedCount++; if (args.Updated.Count == 1) this.updatedCount++; if (args.Removed.Count == 1) this.deletedCount++; }
private void OnGroupsCollectionChanged(GroupsChangedArgs args) { if (IsOrphan) { this.UnregisterEvents(); } else { var levelParams = new GroupsLevelUpdate(this.RootNodes, args); levelParams.Run(); } }
private void DispatcherOnGroupsChanged(GroupsChangedArgs args) { if (args.Added.Count == 1) this.addedGroupId = ((Group)args.Added[0]).Id; if (args.Removed.Count == 1) this.deletedGroupId = ((Group)args.Removed[0]).Id; if (args.Updated.Count == 1) this.updatedGroupId = ((Group)args.Updated[0]).Id; }