AmazonScrape.SearchManager.IsWorkFinished C# (CSharp) Method

IsWorkFinished() private method

True if the search was cancelled, we've reached 100% of the desired number of results, or all of the threads are finished
private IsWorkFinished ( ) : bool
return bool
        private bool IsWorkFinished()
        {
            // If the main search has been cancelled by the user
            if (_working == false)
            {
                string msg = "SearchManager no longer set to 'Working'";
                Debug.WriteLine(msg);
                return true;
            }

            // If all specified results have been returned
            if (GetPercentComplete() >= 100)
            {
                Debug.WriteLine("=== Percent Complete at or above 100 ===");
                return true;
            }

            // If all worker threads are no longer working
            // (finished / no more results to search)
            int workingCount = _pageManagers.Where(i => i.WorkStatus ==
                PageManager.Status.Working).Count();
            if (workingCount == 0)
            {
                Debug.WriteLine("No working PageManagers (none with Working status)");
                OutputPageManagerStatus();
                return true;
            }

            return false;
        }