예제 #1
0
 /// <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;
     }
 }
예제 #2
0
 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;
     }
 }
예제 #3
0
 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() + '%';
     }
 }
예제 #4
0
 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;
     }
 }
예제 #5
0
 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;
     }
 }
예제 #6
0
 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();
         }
     }
 }
예제 #7
0
        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;
        }
예제 #9
0
 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);
     }
 }
예제 #10
0
        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);
            }
        }
예제 #11
0
 /// <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;
         }
     }
 }
예제 #12
0
        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;
        }
예제 #13
0
 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;
     }
 }
예제 #15
0
        private void QuerySumbitted(object sender, RunWorkerCompletedEventArgs e)
        {
            SetValueCallback update = new SetValueCallback(SetProgressBarvalue);

            progress.Dispatcher.Invoke(update, 1);
        }
예제 #16
0
 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;
     }
 }
예제 #17
0
 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;
     }
 }
예제 #18
0
 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;
     }
 }
예제 #19
0
        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();
            }
        }
예제 #20
0
 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 { }
 }
예제 #22
0
 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()+"  ";
     }
 }