/// <summary> /// download text form pages and count it /// </summary> private async void trySyncV2() { //this will call method when progress change Progress <ProgressReportModel> progress = new Progress <ProgressReportModel>(); progress.ProgressChanged += ReportProgress; //counting time System.Diagnostics.Stopwatch watch = System.Diagnostics.Stopwatch.StartNew(); websiteDownloader myDownloader = new websiteDownloader(); myDownloader.progress = progress; var waitToComplete = await myDownloader.downloadAsync(); //myDownloader.downloadReport += addDataToTable; //myDownloader.downloadSync(); watch.Stop(); WpfDataGrid1.Items.Add(new WebSiteDataModel() { timeBeg = watch.ElapsedMilliseconds.ToString() }); }
/// <summary> /// download text form pages and count it /// </summary> private void trySync() { //counting time System.Diagnostics.Stopwatch watch = System.Diagnostics.Stopwatch.StartNew(); websiteDownloader myDownloader = new websiteDownloader(); myDownloader.downloadReport += addDataToTable; myDownloader.downloadSync(); //myDownloader.downloadSync(); watch.Stop(); WpfDataGrid1.Items.Add(new WebSiteDataModel() { timeBeg = watch.ElapsedMilliseconds.ToString() }); }