예제 #1
0
 private void AddPaths(ObservableCollection <string> pathsInternal)
 {
     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");
     }
     if (Custom.Exist())
     {
         _pathsInternal.Add("Custom Game Paths Detected");
     }
     if (Nexon.Exist())
     {
         _pathsInternal.Add("Nexon Games Detected");
     }
 }
        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() +
                         ") ";
        }