示例#1
0
        private void RunRefresh()
        {
            //needs to be called to ensure we aren't loading a previously stored object.
            CleanerUtilities.updateRedistributables = true;
            _pathsInternal.Clear();
            foreach (var steamPath in SteamUtilities.SteamPaths())
            {
                _pathsInternal.Add(steamPath);
            }

            _filesInternal.Clear();
            foreach (var fileViewModel in CleanerUtilities.FindRedistributables().Select(r => new FileViewModel(r.Path, StringUtilities.GetBytesReadable(r.Size))))
            {
                _filesInternal.Add(fileViewModel);
            }

            Statistics = CleanerUtilities.TotalFiles() + " files have been found (" + CleanerUtilities.TotalTakenSpace() + ") ";
        }
        private void RunRefresh()
        {
            //needs to be called to ensure we aren't loading a previously stored object.
            CleanerUtilities.updateRedistributables = true;
            _pathsInternal.Clear();
            var steamPaths = Steam.SteamPaths();

            _pathsInternal.AddRange(steamPaths.Select(steamPath => Steam.FixPath(steamPath)).Where(path => Directory.Exists(path)).ToList());
            if (Gog.Exisit())
            {
                _pathsInternal.Add("GoG Games Detected");
            }
            if (Origin.Exist())
            {
                _pathsInternal.Add("Origin Games Detected");
            }
            if (Uplay.Exist())
            {
                _pathsInternal.Add("Uplay Games Detected");
            }
            if (Battlenet.Exist())
            {
                _pathsInternal.Add("Battle.net Games Detected");
            }
            if (Desura.Exist())
            {
                _pathsInternal.Add("Desura Games Detected");
            }
            _filesInternal.Clear();
            foreach (
                var fileViewModel in
                CleanerUtilities.FindRedistributables()
                .Select(r => new FileViewModel(r.Path, StringUtilities.GetBytesReadable(r.Size))))
            {
                _filesInternal.Add(fileViewModel);
            }

            Statistics = CleanerUtilities.TotalFiles() + " files have been found (" + CleanerUtilities.TotalTakenSpace() +
                         ") ";
        }