本文整理汇总了C#中Progress.Show方法的典型用法代码示例。如果您正苦于以下问题:C# Progress.Show方法的具体用法?C# Progress.Show怎么用?C# Progress.Show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Progress
的用法示例。
在下文中一共展示了Progress.Show方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: button_backup_Click
private void button_backup_Click(object sender, EventArgs e)
{
FolderBrowserDialog fbd = new FolderBrowserDialog();
DialogResult result = fbd.ShowDialog();
if (result == DialogResult.OK)
{
int lastFoo = (int)Enum.GetValues(typeof(ECRComms.program)).Cast<ECRComms.program>().Last();
for (int p = 0; p <= lastFoo; p++)
{
Progress pr = new Progress(Program.ecr);
pr.Show();
string name = ((ECRComms.program)p).ToString();
data = Program.ecr.getprogram((ECRComms.program)p);
pr.Close();
try
{
writedata(data.ToArray(), Path.Combine(fbd.SelectedPath, name + ".dat"));
}
catch (Exception _Exception)
{
Console.WriteLine("Exception caught saving file{0}", _Exception.ToString());
}
}
}
}
示例2: btnLevel_Click
private void btnLevel_Click(object sender, EventArgs e)
{
btnLevel.Enabled = false;
btnPA.Enabled = false;
btnTXCarrier.Enabled = false;
btnLevel.BackColor = Color.Green;
p = new Progress("Calibrate VU RX Level");
p.Show();
Thread t = new Thread(new ThreadStart(CalRXLevel));
t.Name = "Calibrate RX Level Thread";
t.IsBackground = true;
t.Priority = ThreadPriority.Normal;
t.Start();
}
示例3: Button_Click
private async void Button_Click(object sender, RoutedEventArgs e)
{
var newWindow = new Progress();
newWindow.Show();
// The Progress<T> constructor captures our UI context,
// so the lambda will be run on the UI thread.
var progress = new Progress<int>(percent =>
{
textBox1.Text = percent + "%";
newWindow.connectionProgress.Value = percent;
});
// DoProcessing does most of its work on the thread pool.
await DoProcessingOnThreadPoolAsync(progress);
}
示例4: bildSpeichernToolStripMenuItem_Click
private void bildSpeichernToolStripMenuItem_Click(object sender, EventArgs e)
{
Tuple<string, string> data = (Tuple<string, string>)pictureBox1.Tag;
string filetype = string.Empty;
switch (data.Item1)
{
case "image/jpeg":
case "image/jpg":
filetype = "jpg";
break;
}
if (data.Item2.StartsWith("http"))
{
SaveFileDialog sfd = new SaveFileDialog();
sfd.Filter = string.Format("*.{0}|*.{0}", filetype);
GedcomIndividual individual = (GedcomIndividual)familyTreeView.SelectedNode.Tag;
sfd.FileName = individual.Name.ToString();
if (sfd.ShowDialog() == DialogResult.OK)
{
Progress progress = new Progress();
progress.Show();
WebClient client = new WebClient();
string tmpFile = string.Concat(Path.GetTempFileName(), filetype);
client.DownloadProgressChanged += (x, args) => {
progress.ReportProgress(args.ProgressPercentage);
progress.ReportProgress(string.Format("{0} of {1}", args.BytesReceived.FormatBytes(), args.TotalBytesToReceive.FormatBytes()));
};
client.DownloadFileCompleted += (y, args) => {
progress.Close();
};
client.DownloadFileAsync(new Uri(data.Item2), sfd.FileName);
}
}
}
示例5: Main_DragDrop
private void Main_DragDrop(object sender, DragEventArgs e)
{
if (e.Effect == DragDropEffects.Link)
{
e.Effect = DragDropEffects.None;
var filenames = (IEnumerable<string>)e.Data.GetData("FileDrop");
fdbOutputDirectory.SelectedPath = Path.GetDirectoryName(filenames.First());
if (DlgBox.ShowDialog(fdbOutputDirectory, this) == DialogResult.OK)
{
var progressForm = new Progress(new Arguments.Progress
{
InputFilenames = filenames,
OutputDirectory = fdbOutputDirectory.SelectedPath,
CallingForm = this
});
progressForm.Show();
Hide();
}
}
}
示例6: btnHarmFil60_Click
private void btnHarmFil60_Click(object sender, System.EventArgs e)
{
btnCheckAll.PerformClick();
chk60m.Checked = false;
console.PowerOn = true;
console.CurrentMeterTXMode = MeterTXMode.FORWARD_POWER;
progress = new Progress("Calibrate PA Gain");
Thread t = new Thread(new ThreadStart(CalibratePAGain));
t.Name = "PA Gain Calibration Thread";
t.IsBackground = true;
t.Priority = ThreadPriority.AboveNormal;
t.Start();
if(console.PowerOn)
progress.Show();
}
示例7: FillGrid
private void FillGrid()
{
lock (lockReadWrite)
{
// Progress bar for loading the items in the event log
Progress progress = null;
// Reset the counters for event log types
ResetCounters();
// Show the progress bar only if the event log is not on the local machine
if (!((log.MachineName == ".") || (log.MachineName == System.Net.Dns.GetHostName())))
{
progress = new Progress();
progress.Show();
progress.btnCancel.Click += new EventHandler(Progress_Cancel_Click);
}
Application.DoEvents();
this.Cursor = Cursors.WaitCursor;
try
{
dgEvents.SelectionChanged -= dgEvents_SelectionChanged;
DataSet currentEntries = null;
// Retrieve the Event Log Entries via WMI
using (ManagementObjectCollection entries = GetEvents())
{
currentEntries = BuildDataSet(entries, progress);
}
// The request was cancelled
if (currentEntries == null)
{
return;
}
if (bindingSource == null)
{
bindingSource = new BindingSource(currentEntries, "Entries");
}
else
{
bindingSource.DataSource = currentEntries;
}
UpdateBindingSourceFilter();
dgEvents.DataSource = bindingSource;
dgEvents.Refresh();
UpdateCounterButtons();
dgEvents.SelectionChanged += dgEvents_SelectionChanged;
}
catch (Exception ex)
{
MessageBox.Show("Exception caught : " + ex.ToString(), "EventLog Viewer", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
finally
{
this.Cursor = Cursors.Default;
if (progress != null)
{
progress.Close();
}
this.Focus();
}
}
}
示例8: btnRunSignal_Click
private void btnRunSignal_Click(object sender, System.EventArgs e)
{
progress = new Progress("Signal Level Test");
Thread t = new Thread(new ThreadStart(SignalTest));
t.Name = "ProdTestSignal";
t.IsBackground = true;
t.Priority = ThreadPriority.Normal;
t.Start();
if(console.PowerOn)
progress.Show();
}
示例9: OnClosing
/// <summary>
/// When the form closes, make sure the wallet stops refreshing and all work is saved.
/// </summary>
/// <param name="e"></param>
protected async override void OnClosing(System.ComponentModel.CancelEventArgs e)
{
if (!skipExitWrappers)
{
Cursor = Cursors.WaitCursor;
SetStatus(WalletStatus.Ready, "Exiting...");
skipExitWrappers = true;
e.Cancel = true;
Progress progess = new Progress();
progess.Show(this);
var tf = new TaskFactory();
progess.SetProgress("Stopping miners", 0);
await tf.StartNew(() => MinerManager.Exit());
progess.SetProgress("Stopping wallet", 33);
await tf.StartNew(() => Wallet.Exit());
progess.SetProgress("Stopping daemon", 66);
await tf.StartNew(() => Daemon.Exit());
Close();
}
}
示例10: btnRunPACal_Click
private void btnRunPACal_Click(object sender, System.EventArgs e)
{
console.PowerOn = true;
btnRunPACal.Enabled = false;
grpPA.Enabled = false;
grpIO.Enabled = false;
progress = new Progress("Cal PA Bridge/Power/SWR");
btnRunPACal.BackColor = console.ButtonSelectedColor;
Thread t = new Thread(new ThreadStart(PARunCal));
t.Name = "Run PA Cal Thread";
t.IsBackground = true;
t.Priority = ThreadPriority.Normal;
t.Start();
progress.Show();
}
示例11: btnPAVerify_Click
private void btnPAVerify_Click(object sender, System.EventArgs e)
{
grpPA.Enabled = false;
grpIO.Enabled = false;
btnPAVerify.BackColor = console.ButtonSelectedColor;
progress = new Progress("Verify PA Power");
Thread t = new Thread(new ThreadStart(VerifyPA));
t.Name = "Verify PA Power";
t.IsBackground = true;
t.Priority = ThreadPriority.Normal;
t.Start();
progress.Show();
}
示例12: btnPASWR_Click
private void btnPASWR_Click(object sender, System.EventArgs e)
{
progress = new Progress("Cal SWR");
grpPA.Enabled = false;
grpIO.Enabled = false;
btnPASWR.BackColor = console.ButtonSelectedColor;
Thread t = new Thread(new ThreadStart(CalPASWR));
t.Name = "Cal SWR Thread";
t.IsBackground = true;
t.Priority = ThreadPriority.Normal;
t.Start();
progress.Show();
}
示例13: btnPAPower_Click
private void btnPAPower_Click(object sender, System.EventArgs e)
{
grpPA.Enabled = false;
grpIO.Enabled = false;
btnPAPower.BackColor = console.ButtonSelectedColor;
progress = new Progress("Calibrate PA Power");
Thread t = new Thread(new ThreadStart(CalPAPower));
t.Name = "PA Power Cal Thread";
t.IsBackground = true;
t.Priority = ThreadPriority.AboveNormal;
t.Start();
if(console.PowerOn)
progress.Show();
}
示例14: btnNullBridge_Click
private void btnNullBridge_Click(object sender, System.EventArgs e)
{
grpPA.Enabled = false;
grpIO.Enabled = false;
btnNullBridge.BackColor = console.ButtonSelectedColor;
progress = new Progress("Null PA Bridge");
Thread t = new Thread(new ThreadStart(NullBridge));
t.Name = "Null PA Bridge Thread";
t.IsBackground = true;
t.Priority = ThreadPriority.Normal;
t.Start();
progress.Show();
}
示例15: Main
static void Main(string[] args)
{
Progress progressWindow;
PrepareThread prepareThread;
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
progressWindow = new Progress();
prepareThread = new PrepareThread(args, progressWindow);
Thread backgroundThread = new Thread(new ThreadStart(prepareThread.Run));
progressWindow.Show();
backgroundThread.Start();
Application.Run(progressWindow);
}