本文整理汇总了C#中System.ComponentModel.ProgressChangedEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# ProgressChangedEventArgs类的具体用法?C# ProgressChangedEventArgs怎么用?C# ProgressChangedEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProgressChangedEventArgs类属于System.ComponentModel命名空间,在下文中一共展示了ProgressChangedEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: applyProgress
protected void applyProgress(ProgressBar progress, ProgressChangedEventArgs e)
{
if(e.message!=null)
progress.Text = e.message;
progress.Sensitive = e.state== ProgressState.None;
//progress.
//progress.IsIndeterminate = e.state== ProgressState.Indeterminate;
switch(e.state) {
case ProgressState.Normal:
//progress.Foreground = default_progress_color;
break;
case ProgressState.Error:
//progress.Foreground = Brushes.Red;
break;
case ProgressState.Wait:
//progress.Foreground = Brushes.Yellow;
break;
}
progress.Visible = true;
if(e.max==0)
progress.Fraction = 0;
else {
progress.Fraction = (double)e.max/(double)e.value;
}
}
示例2: bw_ProgressChanged
void bw_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
progressBar1.Maximum = 100;
progressBar1.Value = e.ProgressPercentage;
// show downloading message
SetLabel(line1, string.Format(Properties.Resources.ID_DOWNLOADINGFILE, downloadFile, e.ProgressPercentage));
}
示例3: backgroundWorker1_ProgressChanged
private void backgroundWorker1_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
// Change the value of the ProgressBar to the BackgroundWorker progress.
progressBar1.Value = e.ProgressPercentage;
// Set the text.
this.Text = e.ProgressPercentage.ToString();
}
示例4: backgroundWorker_ProgressChanged
//void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
//{
// this.Close();//执行完之后,直接关闭页面
//}
void backgroundWorker_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
this.progressBar.Value = e.ProgressPercentage;
this.labelText.Text = (null != e.UserState) ? e.UserState.ToString() : "";
//this.progressBar1.Value = e.ProgressPercentage;
//this.textBox1.AppendText(e.UserState.ToString());//主窗体传过来的值,通过e.UserState.ToString()来接受
}
示例5: bg_ProgressChanged
void bg_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
progressBar1.Value = e.ProgressPercentage;
GPoint p = (GPoint)e.UserState;
this.Text = "Static Map maker: Downloading[" + p + "]: " + tileArea.IndexOf(p) + " of " + tileArea.Count;
}
示例6: backgroundWorker_ProgressChanged
private void backgroundWorker_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
if (UploadFileProgressChangedToDo != null)
{
UploadFileProgressChangedToDo(null, new AltProgressChangedEventArgs(e.ProgressPercentage / 2));
}
}
示例7: backgroundWorker1_ProgressChanged
private void backgroundWorker1_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
progressBar1.Value = e.ProgressPercentage;
PedigreeSymbolRow psr = (PedigreeSymbolRow)e.UserState;
flowLayoutPanel1.Controls.Add(psr);
label1.Text = flowLayoutPanel1.Controls.Count.ToString();
}
示例8: ProgressChanged
public void ProgressChanged(object sender, ProgressChangedEventArgs e)
{
if (e.UserState is WorkerProgressUserState)
{
var eState = (WorkerProgressUserState)e.UserState;
if (eState.IsProgress)
{
int progressBarIndex = Math.Min(eState.ProgressBarIndex, this.progressBars.Length - 1);
var pb = this.progressBars[progressBarIndex];
if (eState.ProgressValue >= 100)
{
pb.Value = 100;
}
else
{
pb.Value = (int)eState.ProgressValue;
}
}
else
{
AddLine(eState.LabelText);
}
}
if (e.UserState is string)
{
AddLine((string)e.UserState);
}
this.progressBars[0].Value = e.ProgressPercentage;
}
示例9: OnUploadProgressChanged
private void OnUploadProgressChanged(object sender, ProgressChangedEventArgs e)
{
if (ProgressChanged != null)
{
ProgressChanged(sender, e);
}
}
示例10: backgroundWorker1_ProgressChanged
private void backgroundWorker1_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
progressBar1.Value = e.ProgressPercentage;
ActiveSurveyRow asr = (ActiveSurveyRow)e.UserState;
flowLayoutPanel1.Controls.Add(asr);
loadCountLabel.Text = flowLayoutPanel1.Controls.Count.ToString();
}
示例11: backgroundWorker1_ProgressChanged
private void backgroundWorker1_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
curDiv += 1;
string s = (string)e.UserState;
label5.Text = curDiv.ToString() + " / " + divCount.ToString() + " : " + s;
}
示例12: backgroundWorker_ProgressChanged
private void backgroundWorker_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
if(progressBar.Value != e.ProgressPercentage)
progressBar.Value = e.ProgressPercentage;
if (e.UserState != null)
label.Text = string.Format(MessageFormat, e.UserState);
}
示例13: GetDevieBackgroundWorkerOnProgressChanged
public static void GetDevieBackgroundWorkerOnProgressChanged(object sender, ProgressChangedEventArgs e)
{
CheckedListBox c = (CheckedListBox)_o[0];
Button stb = (Button)_o[1];
if (Device.Count == 0)
{
c.Items.Clear();
stb.Enabled = false;
}
else
{
foreach (string de in Device)
{
if (!c.Items.Contains(de))
c.Items.Add(de);
}
List<string> del = (from string s in c.Items where !Device.Contains(s) select s).ToList();
// ReSharper disable once ForCanBeConvertedToForeach
for (int i = 0; i < del.Count; i++)
{
c.Items.Remove(del[i]);
}
stb.Enabled = true;
}
}
示例14: OnProcessingProgress
private void OnProcessingProgress(ProgressChangedEventArgs e)
{
if (Progress != null)
{
Progress(this, e);
}
}
示例15: downBackgroundWorker_ProgressChanged
void downBackgroundWorker_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
if (ProgressChanged != null)
{
ProgressChanged(e.ProgressPercentage);
}
}