//------------------------------------------------------------- public void HashedDelegate(object o, TorrentCreatorEventArgs torrentEvent) //------------------------------------------------------------- { Log.Get().Write("Current File is " + torrentEvent.FileCompletion * 100 + "% hashed"); Log.Get().Write("Overall " + torrentEvent.OverallCompletion * 100 + "% hashed"); Log.Get().Write("Total data to hash: " + torrentEvent.OverallSize); if (kobberLan != null) { kobberLan.Invoke(new Action(() => { TorrentCreator c = (TorrentCreator)o; if (String.IsNullOrEmpty(c.Comment)) { return; } bool status = kobberLan.UpdateProgressBar(TorrentState.Metadata, (int)(torrentEvent.OverallCompletion * 100.0), c.Comment); if (status == false) { c.Hashed -= HashedDelegate; c.Comment = ""; Log.Get().Write("Hashed failed", Log.LogType.Error); } })); } }
private void OnHashed(object sender, TorrentCreatorEventArgs args) { progressDialog.Progress = args.OverallCompletion; }
private void OnHashed(object sender, TorrentCreatorEventArgs args) { Gtk.Application.Invoke(delegate { progressDialog.Progress = args.OverallCompletion; }); }
void Creator_Hashed(object sender, TorrentCreatorEventArgs e) { Dispatcher.Invoke(new Action(() => progressBar.Value = e.FileCompletion)); }