/// <summary> /// Set value property of ProgressBar /// </summary> /// <param name="form">The calling form</param> /// <param name="ctrl"></param> /// <param name="text"></param> public static void SetValue(Form form, ProgressBar ctrl, int value) { // InvokeRequired required compares the thread ID of the // calling thread to the thread ID of the creating thread. // If these threads are different, it returns true. if (ctrl.InvokeRequired) { SetValueCallback d = new SetValueCallback(SetValue); form.Invoke(d, new object[] { form, ctrl, value }); } else { ctrl.Value = value; } }
private void SetValue(string str) { // InvokeRequired required compares the thread ID of the // calling thread to the thread ID of the creating thread. // If these threads are different, it returns true. if (this.showValue.InvokeRequired) { SetValueCallback d = new SetValueCallback(SetValue); this.Invoke(d, new object[] { str }); } else { this.showValue.Text = str; } }
private void SetLabelValue(int value) { if (value == progressBar.Value) { return; } if (this.label.InvokeRequired) { SetValueCallback d = new SetValueCallback(SetLabelValue); this.Invoke(d, new object[] { value }); } else { this.label.Text = value.ToString() + '%'; } }
public static void SetValue <TObject>(TObject objCtrl, int value, Form winf) where TObject : System.Windows.Forms.ProgressBar { if (objCtrl.InvokeRequired) { SetValueCallback d = new SetValueCallback(SetValue); if (winf.IsDisposed) { return; } winf.Invoke(d, new object[] { objCtrl, value, winf }); } else { objCtrl.Value = value; } }
private void SetBarValue(int value) { if (value == progressBar.Value) { return; } if (this.progressBar.InvokeRequired) { SetValueCallback d = new SetValueCallback(SetBarValue); this.Invoke(d, new object[] { value }); } else { this.progressBar.Value = value; } }
private void SetValue(decimal value, string symbol) { if (this.numericUpDown6.InvokeRequired) { SetValueCallback d = new SetValueCallback(SetValue); this.Invoke(d, new object[] { value, symbol }); } else { if (!autoProfit) { this.numericUpDown6.Value = value; } } if (this.numericUpDown8.InvokeRequired) { SetValueCallback d = new SetValueCallback(SetValue); this.Invoke(d, new object[] { value, symbol }); } else { this.numericUpDown8.Value = value; } if (this.textBox4.InvokeRequired) { SetValueCallback d = new SetValueCallback(SetValue); this.Invoke(d, new object[] { value, symbol }); } else { this.textBox4.Text = symbol; } if (this.symbolText.InvokeRequired) { SetValueCallback d = new SetValueCallback(SetValue); this.Invoke(d, new object[] { value, symbol }); } else { errorProvider1.SetError(symbolText, ""); if (errorChecker()) { fieldCalculators(); } } }
static VisitErrorCode TrySetValueImpl <TContainer, TTargetValue>(ref TContainer container, PropertyPath propertyPath, int propertyPathIndex, TTargetValue value, ref ChangeTracker changeTracker) { var action = new SetValueAtPathAction <TContainer, TTargetValue>(propertyPath, propertyPathIndex, value); if (PropertyBagResolver.Resolve <TContainer>() .FindProperty(propertyPath[propertyPathIndex].Name, ref container, ref changeTracker, ref action)) { return(action.ErrorCode); } if (typeof(TContainer) != container.GetType()) { return(SetValueCallback <TTargetValue> .TryExecute(container, propertyPath, propertyPathIndex, value, ref changeTracker)); } return(VisitErrorCode.InvalidPath); }
public ResultSetQueryCommand ( IDbCommand command, string table, string[] columnsFilter, SetValueCallback <T> setValueCallback ) { if (null == columnsFilter || columnsFilter.Length == 0) { throw new ArgumentException("columnsFilter must have at least one column."); } Command = command; Table = table; Columns = columnsFilter; SetValueCallback = setValueCallback; }
internal void SetValue(Form form, dynamic ctrl, dynamic val) { try { if (ctrl.InvokeRequired) { SetValueCallback d = new SetValueCallback(SetValue); form.Invoke(d, new object[] { form, ctrl, val }); } else { ctrl.Value = val; } } catch (Exception e) { MessageBox.Show("# Error setValue \n\n" + e); } }
public void status_changed(int status, string message) { string text = string.Format("status:{0},{1}", status, message); if (this.txtStatus.InvokeRequired) { SetTextCallback d = new SetTextCallback(SetStatusText); this.Invoke(d, new object[] { text }); } if (status == 0) { if (this.pbarExc.InvokeRequired) { SetValueCallback d = new SetValueCallback(SetStatusProgress); this.Invoke(d, new object[] { pbarExc.Value + 1 }); } } using (StreamWriter sr = new StreamWriter("scrapy.log", true, Encoding.UTF8)) { sr.WriteLine(DateTime.Now.ToString("yyyymmdd HH:MM:ss") + " " + message); } }
/// <summary> /// Sets the number of items processed /// </summary> /// <param name="value">The value.</param> public static void SetValue(int value) { if (instance.InvokeRequired) //if another thread called this method { SetValueCallback s = new SetValueCallback(SetValue); instance.Invoke(s, value); } else { if (instance.progressBar.Maximum > 0) { instance.progressBar.Value = value; if (!actionBaseText.Equals("")) instance.lblProgress.Text = actionBaseText + " " + value + "/" + instance.progressBar.Maximum; else instance.lblProgress.Text = actionText; } else { instance.lblProgress.Text = actionText + " " + value; } } }
private void SetValue(int value) { if (this.TestProgressBar.InvokeRequired) { SetValueCallback c = new SetValueCallback(SetValue); this.Invoke(c, new object[] { value }); } else { this.TestProgressBar.Value= value; } this.TestProgressBar.Value = value; }
private void SetProcessBarValue() { if (this.lsubmit.InvokeRequired) { SetValueCallback d = new SetValueCallback(SetProcessBarValue); this.Invoke(d, new object[] { }); } else { this.lsubmit.Visible = true; } }
public void setValue(int value) { // InvokeRequired required compares the thread ID of the // calling thread to the thread ID of the creating thread. // If these threads are different, it returns true. if (this.progressBarProgressInformation.InvokeRequired) { SetValueCallback d = new SetValueCallback(setValue); this.Invoke(d, new object[] { value }); } else { this.progressBarProgressInformation.Value = value; } }
private void QuerySumbitted(object sender, RunWorkerCompletedEventArgs e) { SetValueCallback update = new SetValueCallback(SetProgressBarvalue); progress.Dispatcher.Invoke(update, 1); }
private void UpdateDownloadProgressBar(int value) { if (this.progBarDownloadAll.InvokeRequired) { var d = new SetValueCallback(UpdateDownloadProgressBar); this.Invoke(d, new object[] { value }); } else { this.progBarDownloadAll.Value = value; } }
private void SetProcessBarValue(int value) { if (this.progressBar1.InvokeRequired) { SetValueCallback d = new SetValueCallback(SetProcessBarValue); this.Invoke(d, new object[] { value }); } else { this.progressBar1.Value = value; } }
public void InitProcessbar(int value) { if (InvokeRequired) { SetValueCallback s = new SetValueCallback(InitProcessbar); Invoke(s, new object[] { value }); } else { PB_1.Value = value; PB_1.Maximum = value; PB_1.Visible = false; } }
private void SetValue(string value, ICell cell) { if (cell.Grid.InvokeRequired) { SetValueCallback d = new SetValueCallback(SetValue); this.Invoke(d, new object[] { value, cell }); } else { cell.Value = value; grid1.AutoSizeCells(); } }
public void UpdateProcessbar(int value) { if (this.InvokeRequired) { SetValueCallback s = new SetValueCallback(UpdateProcessbar); this.Invoke(s, new object[] { value }); } else PB_1.Value += value; }
private void Set_prbMain_Value(int v) { // InvokeRequired required compares the thread ID of the // calling thread to the thread ID of the creating thread. // If these threads are different, it returns true. try { if (this.prbMain.InvokeRequired) { SetValueCallback d = new SetValueCallback(Set_prbMain_Value); this.Invoke(d, new object[] { v }); } else { this.prbMain.Value = v; } } catch { } }
private void SetLabelValue(int value) { // InvokeRequired required compares the thread ID of the // calling thread to the thread ID of the creating thread. // If these threads are different, it returns true. if (this.statusStrip1.InvokeRequired) { SetValueCallback d = new SetValueCallback(SetLabelValue); this.Invoke(d, new object[] { value }); } else { this.toolStripStatusLabel2.Text = "已完成:" + value.ToString() + " / "+CountTemp.ToString()+" "; } }