Example #1
0
        public void Accept(ProgressEvent progressEvent)
        {
            progressEvent = progressEvent ?? throw new ArgumentNullException(nameof(progressEvent));
            Allocation allocation         = progressEvent.GetAllocation();
            long       progressUnits      = progressEvent.GetUnits();
            double     allocationFraction = allocation.GetFractionOfRoot();

            if (progressUnits != 0)
            {
                progress.Add(progressUnits * allocationFraction);
            }

            if (completionTracker.UpdateProgress(allocation, progressUnits))
            {
                // Note: Could produce false positives.
                updateNotifier(new Update(progress.Sum(), completionTracker.GetUnfinishedLeafTasks()));
            }
        }