예제 #1
0
        internal void ReportGroupsUpdated(IList <IGroup> updatedGroups)
        {
            var args = new GroupsChangedArgs();

            args.Updated.AddRange(updatedGroups);
            this.FireGroupsChanged(args);
        }
예제 #2
0
 internal void EndDelayedUpdate()
 {
     this.FireGroupsChangedEvent(this.groups);
     this.groups = null;
     this.FireFavoritesChangedEvent(this.favorites);
     this.favorites = null;
 }
예제 #3
0
        internal void ReportGroupsDeleted(List <IGroup> deletedGroups)
        {
            var args = new GroupsChangedArgs();

            args.Removed.AddRange(deletedGroups);
            this.FireGroupsChanged(args);
        }
예제 #4
0
        internal void ReportGroupsAdded(List <IGroup> addedGroups)
        {
            var args = new GroupsChangedArgs();

            args.Added.AddRange(addedGroups);
            this.FireGroupsChanged(args);
        }
예제 #5
0
 internal void StartDelayedUpdate()
 {
     if (this.DelayedUpdate)
     {
         return;
     }
     this.groups    = new GroupsChangedArgs();
     this.favorites = new FavoritesChangedEventArgs();
 }
예제 #6
0
        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);
 }
예제 #8
0
 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++;
 }
예제 #9
0
 private void DeliverGroupsChanges(GroupsChangedArgs args)
 {
     if (this.DelayedUpdate)
     {
         this.groups.AddFrom(args);
     }
     else
     {
         this.FireGroupsChangedEvent(args);
     }
 }
예제 #10
0
        private void FireGroupsChangedEvent(GroupsChangedArgs args)
        {
            // prevent persistence dummy call without start update
            if (args == null)
            {
                return;
            }

            Debug.WriteLine(args.ToString());

            this.GroupsChanged?.Invoke(args);
        }
예제 #11
0
        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);
        }
예제 #12
0
        internal void ReportGroupsRecreated(List <IGroup> addedGroups, List <IGroup> deletedGroups)
        {
            var args = new GroupsChangedArgs(addedGroups, deletedGroups);

            this.FireGroupsChanged(args);
        }
예제 #13
0
 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();
     }
 }
예제 #15
0
 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;
 }