private void bgwScan_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e) { ShowForm(); string result = Convert.ToString(e.UserState); if (Utils.IsNullOrEmpty(result)) { UI.ShowWarning(UIRes.I18N("NoValidQRcodeFound")); } else { int ret = MainFormHandler.Instance.AddBatchServers(config, result); if (ret > 0) { RefreshServers(); UI.Show(UIRes.I18N("SuccessfullyImportedServerViaScan")); } } }
private void backgroundWorker1_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e) { switch (e.ProgressPercentage) { /// Outuput case 0: textBoxOutput.AppendText(Environment.NewLine + e.UserState as String); break; /// Exception case 1: textBoxOutput.AppendText(Environment.NewLine + e.UserState as String); break; /// Input case 2: textBoxOutput.AppendText(Environment.NewLine + ">>> " + e.UserState as String); break; } }
private void BackgroundWorker_Progress(object sender0, System.ComponentModel.ProgressChangedEventArgs e0) { Element el = new Element(); StorageTV sTv = (StorageTV)e0.UserState; el.Name = "Element" + sTv.Index; el.Title = sTv.Title; el.TitleUrl = sTv.TitleUrl; el.Episode = sTv.Episode; el.EpisodeUrl = sTv.EpisodeUrl; el.Index = sTv.Index; el.Location = new Point(0, (sTv.Index * 38) / 1 + 38); el.Expand = sTv.Expand; el.Type = sTv.Type; if (sTv.Type == "lastep") { el.titleLabel.ForeColor = Color.FromArgb(255, 204, 51, 51); el.episodeLabel.ForeColor = Color.FromArgb(255, 204, 51, 51); } if (sTv.Type == "firstep") { el.titleLabel.ForeColor = Color.FromArgb(255, 130, 202, 59); el.episodeLabel.ForeColor = Color.FromArgb(255, 130, 202, 59); } if (sTv.Index % 2 == 0) { el.BackColor = Color.FromArgb(255, 44, 44, 44); } else { el.BackColor = Color.FromArgb(255, 53, 53, 53); } el.titleLabel.Click += (sender, e) => openSeries(sender, e, el.TitleUrl); el.episodeLabel.Click += (sender, e) => openSeries(sender, e, el.EpisodeUrl); this.Controls.Add(el); }
private void PicsbgWorker_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e) { if (PrintState.alert && MessageBox.Show("Printing issue: " + ((PrinterState)e.UserState).status, "Print Error", MessageBoxButtons.RetryCancel) == DialogResult.Cancel) { PrintIO.AbortPrinting(); } if (e.ProgressPercentage == 25) { PrintStatusLbl.Text = "Printing receipt"; } if (e.ProgressPercentage == 50) { PrintStatusLbl.Text = "Printing pics"; } if (e.ProgressPercentage == 75) { PrintStatusLbl.Text = "Checking print status"; } }
private void backgroundWorker1_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e) { if (e.ProgressPercentage == 100) { try { label4.Text = "Enable"; label4.ForeColor = Color.ForestGreen; } catch { } } else { try { label4.Text = "Unable"; label4.ForeColor = Color.Red; } catch { } } }
public void backgroundWorker_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e) { feedBackLabel2.Visible = true; feedBackLabel2.Text = $" {Math.Round((e.ProgressPercentage / inputFileTags.duration) * 100, 2)}%"; if (e.UserState != null) { if (e.UserState.GetType() == typeof(SoundFile)) { if (outputFiles.CountOfSoundFiles == 1) { var outFiles = outputFiles.GetOutputFiles(); if (outFiles[0].endTimeSeconds == 0 && outFiles[0].startTimeSeconds == 0) { deleteButton_Click(null, null); } } addSoundFile((SoundFile)e.UserState); outputFiles.IncreaseIndex(); EnableObjects(false); } } }
void root_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e) { var report = e.UserState as Tool.ReportEvnetArgs; if (report.Message.Contains(countLabel)) { count++; textBlock3.Text = count.ToString(); } if (report.Visible) { if (textBox1.Text.Length > maxTextSize) { textBox1.Text = textBox1.Text.Substring(maxTextSize / 5); } textBox1.Text += report.Message; if (report.ReturnCode) { textBox1.Text += "\n"; } } }
private void backgroundWorker1_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e) { if (e.ProgressPercentage != 0) { //contar pro label if (e.ProgressPercentage != 100) { //Incrementa o valor da progressbar com o valor //atual do progresso da tarefa. progressBarControl1.Increment(1); } else { progressBarControl1.Increment(progressBarControl1.Properties.Maximum); } //registra na barra progressBarControl1.Update(); //informa o percentual na forma de texto lblPercent.Text = e.ProgressPercentage.ToString() + "%"; } }
private void _backgroundWorker1_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e) { IResult result; while (_resultsQueue.TryDequeue(out result)) { _metrics.Add(result); foreach (ICheckpoint checkpoint in result.Checkpoints) { if (checkpoint.Error != null) { AppendMessage($"{checkpoint.Name}\r\n{checkpoint.Error}"); } } } string jsonResult = JsonConvert.SerializeObject(GetData(), Formatting.Indented); resultsTextBox.Text = jsonResult; RefreshWindowTitle(); }
private void CreateZip_BackgroundWorker_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e) { if (CreateZip_BackgroundWorker.CancellationPending) { return; } var state = (ZipperBackgroundWorkerProgressState)e.UserState; if (!string.IsNullOrEmpty(state.Text)) { ZipStatus_Label.Text = state.Text; } if (state.Type == ZipperBackgroundWorkerProgressType.Add) { if (state.AddEntryAction == ZipperBackgroundWorkerProgressEntryAction.Reset) { _entriesAdded = 0; Zip_ProgressBar.Value = 0; } else if (state.AddEntryAction == ZipperBackgroundWorkerProgressEntryAction.Add) { _entriesAdded++; Zip_ProgressBar.Value = _entriesAdded * 100 / e.ProgressPercentage; } } else { Zip_ProgressBar.Value = e.ProgressPercentage; } if (!string.IsNullOrEmpty(state.Error)) { MessageBox.Show(state.Error, "Zipper Error", MessageBoxButtons.OK, MessageBoxIcon.Error); CreateZip_BackgroundWorker.CancelAsync(); } }
private void Bgworker_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e) { switch ((Status)e.ProgressPercentage) { case Status.CheckJava: labelStatus.Content = "Checking Java..."; break; case Status.CheckMFG: labelStatus.Content = "Checking MyFleetGirls Binary..."; break; case Status.DownloadMFG: labelStatus.Content = "Downloading MyFleetGirls Downloader..."; break; case Status.CheckUpdate: labelStatus.Content = "Checking MyFleetGirls Updates." + Environment.NewLine + "This may take a while, please be Patient." + Environment.NewLine + "(Approx. 3 mins on 10Mb cable if update is needed)"; buttonMirror.Visibility = Visibility.Visible; break; case Status.MirrorUpdate: labelStatus.Content = "Try alternative mirror instead..." + Environment.NewLine + "This might be faster."; buttonMirror.Visibility = Visibility.Hidden; break; case Status.Done: labelStatus.Content = "All systems green."; buttonMirror.Visibility = Visibility.Hidden; break; default: throw new NotImplementedException(); } }
private void backgroundWorker1_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e) { var counter = e.ProgressPercentage + 1; var percent = counter * 100 / _files.Length; var fileName = (string)e.UserState; if (!string.IsNullOrWhiteSpace(fileName)) { var fileInfo = new FileInfo(fileName); listView1.Items.Add(new ListViewItem(new[] { $"{counter}", fileInfo.Name, fileInfo.DirectoryName, fileInfo.CreationTime.ToShortDateString(), $"{(double)fileInfo.Length/ (1024 * 1024):F} mb" })); } toolStripProgressBar1.ToolTipText = $"{percent}%"; toolStripProgressBar1.Value = percent; }
private void backgroundWorker1_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e) { if (toolStripProgressBar1.Value > 10) { toolStripProgressBar1.Value = 0; _backgroundInt = 0; } else { toolStripProgressBar1.Value = _backgroundInt; toolStripStatusLabel1.Text = $@"{_backgroundInt}0%"; } if (_backgroundInt == 10) { if (backgroundWorker1.IsBusy) { backgroundWorker1.WorkerSupportsCancellation = true; backgroundWorker1.CancelAsync(); } Close(); } }
private void Worker_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e) { this.pBar.Value = e.ProgressPercentage; if (this.pBar.Value >= 100) { try { PluginLoader loader = new PluginLoader(); loader.LoadPluginsFromAPI(LoaderConfig); Core.LogWritter.Write("Loaded " + PluginLoader.Plugins.Count + " remote plugins."); } catch (Exception ex) { Core.LogWritter.Write("Error remote plugins init: " + ex.ToString()); } foreach (IPlugin plugin in PluginLoader.Plugins.Where(p => p.LoadType == LoadType.ON_GAME_START)) { plugin.Parameters = new System.Collections.Generic.List <Parameter> { new Parameter() { Id = "ConquerProcessId", Value = CurrentConquerProcess.Id.ToString() }, new Parameter() { Id = "GameServerIP", Value = SelectedServer.GameHost } }; plugin.Run(); Core.LogWritter.Write("Run plugin on start: " + plugin.Name + "."); } if (LoaderConfig.CloseOnFinish) { Environment.Exit(0); } } }
private void backgroundWorker_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e) { progressBar.Value = e.ProgressPercentage; Bitmap bitmap = pictureBox.Image as Bitmap; if (null == bitmap) { return; } int count = m_quePixel.Count; lock (m_quePixel) for (int i = 0; i < count; ++i) { Pixel p = m_quePixel.Dequeue(); p.draw(bitmap); } pictureBox.Refresh(); if (e.UserState is long) { menuItemTrace.Text = "Trace: " + ((long)e.UserState).ToString(); } }
private void backgroundWorker2_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e) { string value = e.UserState as string; if (!string.IsNullOrEmpty(value)) { var timeRun = Convert.ToInt32(value); if (lblStatus.Text == @"OK") { if (timeRun == 3) { txtBarcode.Focus(); _result = ""; _barcodeOld = ""; SetStatusDefault("N/A"); SetMessageDefault("Waiting..."); if (!backgroundWorker1.IsBusy) { backgroundWorker1.RunWorkerAsync(); } } } } }
private void Worker_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e) { this.pBar.Value = e.ProgressPercentage; if (this.pBar.Value >= 100) { if (Constants.CloseOnFinish) { LoaderEvents.LauncherExitStartEvent(new List <Parameter>() { new Parameter() { Id = "CLOSE_MESSAGE", Value = "Finished" } }); Environment.Exit(0); } if (Constants.HideInTrayOnFinish) { if (Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName).Count() > 1) { LoaderEvents.LauncherExitStartEvent(new List <Parameter>() { new Parameter() { Id = "CLOSE_MESSAGE", Value = "Finished" } }); Environment.Exit(0); } else { WindowState = FormWindowState.Minimized; } } } }
private void BgwDrawing_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e) { throw new System.NotImplementedException(); }
private void InitialSyncer_BW_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e) { SetProgress(e.ProgressPercentage); }
protected virtual void OnProgressChanged(System.ComponentModel.ProgressChangedEventArgs e) { }
private void bgWorkerLoadData_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e) { //this.progressLoading.Visible = true; //this.progressLoading.IsRunning = true; }
private void backgroundWorker1_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e) { if (!backgroundWorker1.CancellationPending) { var obj = (MyWorkerClass)e.UserState; txtLogging.AppendText("-----------------------------------------\n"); txtLogging.AppendText(obj.Index + " -- " + obj.PersonId + " - [" + obj.Name + "] processed ..."); if (obj.classes.Any()) { foreach (var clsItem in obj.classes) { txtLogging.AppendText("\n"); if (!string.IsNullOrEmpty(clsItem.message)) { txtLogging.AppendText(clsItem.message); } if (clsItem.result != null) { txtLogging.AppendText(">> Import CLASS " + clsItem.name + " is " + clsItem.result.Status + "\n"); if (!string.IsNullOrEmpty(clsItem.result.Message)) { txtLogging.AppendText(clsItem.result.Message); } if (clsItem.result.Errors != null) { string validationError = string.Join(", \n", clsItem.result.Errors.Cast <ValidationError>().ToList().Select(x => x.Message).ToList()); txtLogging.AppendText(validationError); } } } } if (obj.exams.Any()) { foreach (var clsItem in obj.exams) { txtLogging.AppendText("\n"); if (!string.IsNullOrEmpty(clsItem.message)) { txtLogging.AppendText(clsItem.message); } if (clsItem.result != null) { txtLogging.AppendText(">> Import EXAM " + clsItem.name + " is " + clsItem.result.Status + "\n"); if (!string.IsNullOrEmpty(clsItem.result.Message)) { txtLogging.AppendText(clsItem.result.Message); } if (clsItem.result.Errors != null) { string validationError = string.Join(", \n", clsItem.result.Errors.Cast <ValidationError>().ToList().Select(x => x.Message).ToList()); txtLogging.AppendText(validationError); } } } } txtLogging.AppendText("\n"); progressBar1.Value = e.ProgressPercentage; lblTotalRows.Text = @"Students processed : " + e.ProgressPercentage + 1; } }
private void OBackgroundWorker_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e) { Utility.MainWindow.MainProgressBar.Value = e.ProgressPercentage; }
/// <summary> /// 扫描器报告进度 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void TargetScanner_ProcessReport(object sender, System.ComponentModel.ProgressChangedEventArgs e) { //e.UserState 即为文章实体对象,但如果此时加入界面因为预览图像尚未下载成功而导致无法显示预览图的可能性更大,而且无法对新文章、缓存文章、已读文章分组显示 this.TargetTabPage.Text = $"{this.TargetScanner.SADESource}-发现:{e.ProgressPercentage}"; Application.DoEvents(); }
private void bgwThreadArquivo_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e) { txtLog.Text += (String)e.UserState; }
private void TickTackerProgressReport(object sender, System.ComponentModel.ProgressChangedEventArgs progressReport) { progressBar.Value = progressReport.ProgressPercentage; }
private void backgroundUploadInfo_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e) { progressBar.Value = e.ProgressPercentage; }
private void BackgroundWorker_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e) { progressBar.PerformStep(); }
private void bgwkCleanupDesktop_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e) { tspbOperation.Value = e.ProgressPercentage; MessageBox.Show(" tspbOperation.Value=" + tspbOperation.Value, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); }
private void subscriptionWorker_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e) { queryStatusBar1.UpdateStatusLabel(e.UserState.ToString()); }