Exemplo n.º 1
0
        public CheckFilesViewModel()
        {
            var updater = new Updater(
                IniLoader.Instance.Read("LocalManifest", "General"),
                IniLoader.Instance.Read("ServerManifest", "General"));
            var fileChecker = new FileChecker(updater.GetPatches(true));

            fileChecker.OnUpdateCurrentInfo += FileCheckerOnUpdateCurrentInfo;

            var queue = new Queue <DownloadFile>();

            fileChecker.GetCorruptedFiles().ForEach(file => queue.Enqueue(file));
            _amountCorruptedFiles = queue.Count;
            var downloader = new DownloadManager(queue, 0);

            downloader.OnProgressChanged  += _onProgressChanged;
            downloader.OnDownloadComplete += _onDownloadFinished;
            downloader.OnFileChanged      += DownloaderOnFileChanged;
            downloader.StartDownload();
        }