本文整理汇总了C#中Progress.ShowDialog方法的典型用法代码示例。如果您正苦于以下问题:C# Progress.ShowDialog方法的具体用法?C# Progress.ShowDialog怎么用?C# Progress.ShowDialog使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Progress
的用法示例。
在下文中一共展示了Progress.ShowDialog方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btn_list_Click
void btn_list_Click(object sender, EventArgs e)
{
string RecievedData=null;
names.Clear();
ips.Clear();
using (Client client = new Client())
{
Thread t = new Thread(() => RecievedData = client.Retrieve(Player.Name));
t.Start();
Progress p = new Progress();
p.ShowDialog();
string name = RecievedData.Substring(0, RecievedData.IndexOf('&'));
string ip = RecievedData.Substring(RecievedData.IndexOf('&') + 1);
for (int startindx = 0, length = name.IndexOf('*'), prv = length; startindx < name.Length; )
{
names.Add(name.Substring(startindx, length));
startindx = prv + 1;
prv = name.IndexOf('*', startindx);
length = prv - startindx;
}
for (int startindx = 0, length = ip.IndexOf('*'), prv = length; prv != -1; )
{
ips.Add(ip.Substring(startindx, length));
startindx = prv + 1;
prv = ip.IndexOf('*', startindx);
length = prv - startindx;
}
foreach (string s in names)
AvailablePlayers.Items.Add(s);
}
}
示例2: Button_Click_2
private void Button_Click_2(object sender, RoutedEventArgs e)
{
string value_id = this.taskIdField.Text;
string value_name = this.userNameField.Text;
Progress progress = new Progress();
progress.TaskIDValue = value_id;
progress.UserNameValue = value_name;
progress.ShowDialog();
}
示例3: showProgressWindow
public static void showProgressWindow()
{
if (Environment.UserInteractive)
{
instance = new Progress();
DateTime start = DateTime.Now;
instance.s.WaitOne(); // wait for first call to reportProgress()
while (DateTime.Now < start.AddSeconds(3))
Thread.Sleep(500);
instance.ShowDialog();
}
}
示例4: randoopExe
private void randoopExe(DTE2 application)
{
{
//////////////////////////////////////////////////////////////////////////////////
//step 1. when load randoop_net_addin, the path of "randoop" is defined
//////////////////////////////////////////////////////////////////////////////////
string installPath = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
var randoop_path =
installPath + "\\Randoop-NET-release";
//////////////////////////////////////////////////////////////////////////////////
// step 2. create win form (if an item is or is not selected in solution explorer)
//////////////////////////////////////////////////////////////////////////////////
UIHierarchy solutionExplorer = application.ToolWindows.SolutionExplorer;
var items = solutionExplorer.SelectedItems as Array;
var arg = new Arguments(randoop_path);
//if (items.Length >= 1)
if (items.Length == 1)
{
/*
if (items.Length > 1)
{
MessageBox.Show("Select only one item.", "ERROR");
return;
}*/
UIHierarchyItem item1 = items.GetValue(0) as UIHierarchyItem;
var prJItem = item1.Object as ProjectItem;
if (prJItem != null)
{
string prjPath = prJItem.Properties.Item("FullPath").Value.ToString();
if (prjPath.EndsWith(".dll") || prjPath.EndsWith(".exe"))
arg.SetDllToTest(prjPath);
}
}
//////////////////////////////////////////////////////////////////////////////////
// step 3. show the win form
//////////////////////////////////////////////////////////////////////////////////
arg.ShowDialog();
if (arg.ifContinue() == false)
{
//MessageBox.Show("not going to execute Randoop.");
return;
}
//////////////////////////////////////////////////////////////////////////////////
// step 4. run Randoop.exe while reporting progress
//////////////////////////////////////////////////////////////////////////////////
string exepath = randoop_path + "\\bin\\Randoop.exe";
if (!File.Exists(exepath))
{
MessageBox.Show("Can't find Randoop.exe!", "ERROR");
return;
}
var prg = new Progress();
int totalTime = arg.GetTimeLimit();
prg.getTotalTime(totalTime);
prg.setRandoopExe(exepath);
prg.setRandoopArg(arg.GetRandoopArg());
/*
prg.ShowDialog();
if (prg.isNormal() == false)
{
return;
}
*/
//////////////////////////////////////////////////////////////////////////////////
// step 5. convert all test files to one RandoopTest.cs
//////////////////////////////////////////////////////////////////////////////////
//MessageBox.Show("Randoop finishes generating test cases.", "Progress"); // [progress tracking]
string out_dir = arg.GetTestFilepath();
int nTestPfile = arg.GetTestNoPerFile();
prg.setOutDir(out_dir);
prg.setTestpFile(nTestPfile);
//toMSTest objToMsTest = new toMSTest();
//MessageBox.Show("Converting test cases to MSTest format.", "Progress"); // [progress tracking]
//objToMsTest.Convert(out_dir, nTestPfile);
//////////////////////////////////////////////////////////////////////////////////
// step 6. add/include RandoopTest.cs in a/the Test Project
//////////////////////////////////////////////////////////////////////////////////
//.........这里部分代码省略.........
示例5: FixButton_Click
private void FixButton_Click(object sender, EventArgs e)
{
// Verify ffmpeg is in the directory
if (System.IO.File.Exists(path + "\\" + ffmpeg) == false)
{
MessageBox.Show(ffmpeg + " was not found.\nMake sure that it is located in the same folder as this application.", "Error");
return;
}
// Generate output filename
if (inputfilename.ToLower().EndsWith(".mpg") || inputfilename.ToLower().EndsWith(".mp4"))
{
outputfilename = inputfilename.Remove(inputfilename.Length - 4, 4) + "-VMX.mpg";
}
else if (inputfilename.ToLower().EndsWith(".mpeg"))
{
outputfilename = inputfilename.Remove(inputfilename.Length - 5, 5) + "-VMX.mpeg";
}
else
{
outputfilename = inputfilename + "-VMX.mpg";
}
// Check if output file exists
if (System.IO.File.Exists(outputfilename) == true)
{
if (MessageBox.Show("The output file already exists.\nWould you like to overwrite it?", "Warning", MessageBoxButtons.YesNo) == DialogResult.No)
return;
}
// Start a new thread and run the encoder
t = new Thread(new ThreadStart(this.run_stuff));
t.Start();
canceled = false;
// Open the progress window
progress_form = new Progress();
progress_form.ShowDialog();
}
示例6: Compare
private void Compare()
{
SetStatusWorking();
_eltl.Reset();
traceViewer1.Clear();
_progress = new Progress();
backgroundWorker1.RunWorkerAsync();
_progress.ShowDialog(this);
}
示例7: button1_Click
private void button1_Click(object sender, EventArgs e)
{
IServerConnection con = m_connection;
if (chkUseDifferentConnection.Checked)
{
if (UseNativeAPI.Checked)
{
string webconfig = System.IO.Path.Combine(Application.StartupPath, "webconfig.ini"); //NOXLATE
if (!System.IO.File.Exists(webconfig))
{
MessageBox.Show(this, string.Format(Strings.MissingWebConfigFile, webconfig), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
try
{
var initP = new NameValueCollection();
initP["ConfigFile"] = webconfig; //NOXLATE
initP["Username"] = Username.Text; //NOXLATE
initP["Password"] = Password.Text; //NOXLATE
con = ConnectionProviderRegistry.CreateConnection("Maestro.LocalNative", initP); //NOXLATE
}
catch (Exception ex)
{
string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
MessageBox.Show(this, string.Format(Strings.ConnectionError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
}
else
{
try
{
var initP = new NameValueCollection();
initP["Url"] = MapAgent.Text; //NOXLATE
initP["Username"] = Username.Text; //NOXLATE
initP["Password"] = Password.Text; //NOXLATE
initP["AllowUntestedVersion"] = "true"; //NOXLATE
con = ConnectionProviderRegistry.CreateConnection("Maestro.Http", initP); //NOXLATE
}
catch (Exception ex)
{
string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
MessageBox.Show(this, string.Format(Strings.ConnectionError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
}
}
try
{
TilingRunCollection bx = new TilingRunCollection(con);
if (LimitTileset.Checked)
{
if (MaxRowLimit.Value > 0)
bx.LimitRows((int)MaxRowLimit.Value);
if (MaxColLimit.Value > 0)
bx.LimitCols((int)MaxColLimit.Value);
}
if (UseOfficialMethod.Checked)
{
bx.Config.MetersPerUnit = (double)MetersPerUnit.Value;
bx.Config.UseOfficialMethod = true;
}
bx.Config.ThreadCount = (int)ThreadCount.Value;
bx.Config.RandomizeTileSequence = RandomTileOrder.Checked;
foreach (Config c in ReadTree())
{
MapTilingConfiguration bm = new MapTilingConfiguration(bx, c.MapDefinition);
bm.SetGroups(new string[] { c.Group });
bm.SetScalesAndExtend(c.ScaleIndexes,c.ExtentOverride);
bx.Maps.Add(bm);
}
Progress p = new Progress(bx);
if (p.ShowDialog(this) != DialogResult.Cancel)
{
var ts = p.TotalTime;
MessageBox.Show(string.Format(Strings.TileGenerationCompleted, ((ts.Days * 24) + ts.Hours), ts.Minutes, ts.Seconds));
}
}
catch (Exception ex)
{
string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
MessageBox.Show(this, string.Format(Strings.InternalError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
示例8: con_Progress_Click
private void con_Progress_Click(object sender, EventArgs e)
{
var progress = new Progress();
if (progress.ShowDialog(this) == DialogResult.OK)
{
this.Cursor = Cursors.WaitCursor;
ApplyActionToFrames("Progress", ActionEnum.Progress);
this.Cursor = Cursors.Default;
}
progress.Dispose();
GC.Collect();
}
示例9: Export
private void Export(string filename, int type)
{
Progress dialog = new Progress();
dialog.Text = "Exporting...";
System.Threading.ThreadPool.QueueUserWorkItem(new System.Threading.WaitCallback(DoExport),new ImportExportParameters(filename,type,dialog));
dialog.ShowDialog(this);
}
示例10: btnReconstruct_Click
private void btnReconstruct_Click(object sender, System.EventArgs e)
{
progressDlg = new Progress();
progressDlg.Message = _luke.resources.GetString("CollectingTerms");
int docNum = 0;
try
{
docNum = Int32.Parse(textDocNum.Text);
}
catch (Exception)
{
_luke.ShowStatus(_luke.resources.GetString("DocNotSelected"));
return;
}
Document document = CreateDocument(docNum);
if (document == null)
return;
Hashtable doc = new Hashtable();
this.Cursor = Cursors.WaitCursor;
// async call to reconstruction
ReconstructDelegate reconstruct = new ReconstructDelegate(BeginAsyncReconstruction);
reconstruct.BeginInvoke(docNum, document, doc, new AsyncCallback(EndAsyncReconstruction), null);
progressDlg.ShowDialog(this);
this.Cursor = Cursors.Default;
EditDocument editDocDlg = new EditDocument(_luke, docNum, document, doc);
editDocDlg.ShowDialog();
if (editDocDlg.DialogResult == DialogResult.OK)
{
_luke.InitOverview();
}
}
示例11: Main
//.........这里部分代码省略.........
{
batchMode = true;
}
try
{
Console.Clear();
m_logableProgress = true;
}
catch
{
hasConsole = false;
m_logableProgress = false;
}
IServerConnection connection = null;
string[] maps = mapdefinitions.Split(',');
SetupRun sr = null;
if (!opts.ContainsKey("username") || (!opts.ContainsKey("mapagent")))
{
if (!batchMode)
{
if (opts.ContainsKey("provider") && opts.ContainsKey("connection-params"))
{
var initP = ConnectionProviderRegistry.ParseConnectionString(opts["connection-params"]);
connection = ConnectionProviderRegistry.CreateConnection(opts["provider"], initP);
sr = new SetupRun(connection, maps, opts);
}
else
{
var frm = new LoginDialog();
if (frm.ShowDialog() != System.Windows.Forms.DialogResult.OK)
return;
connection = frm.Connection;
sr = new SetupRun(frm.Username, frm.Password, connection, maps, opts);
}
try
{
mapagent = connection.GetCustomProperty("BaseUrl").ToString();
}
catch { }
}
}
if (connection == null)
{
var initP = new NameValueCollection();
if (!opts.ContainsKey("native-connection"))
{
initP["Url"] = mapagent;
initP["Username"] = username;
initP["Password"] = password;
initP["Locale"] = System.Globalization.CultureInfo.CurrentUICulture.TwoLetterISOLanguageName;
initP["AllowUntestedVersion"] = "true";
connection = ConnectionProviderRegistry.CreateConnection("Maestro.Http", initP);
}
else if (opts.ContainsKey("provider") && opts.ContainsKey("connection-params"))
{
initP = ConnectionProviderRegistry.ParseConnectionString(opts["connection-params"]);
connection = ConnectionProviderRegistry.CreateConnection(opts["provider"], initP);
示例12: btnCalculate_Click
private void btnCalculate_Click(object sender, EventArgs e)
{
if (!didgeValid)
{
ShowError("There is an error with the entered dimensions.");
return;
}
tabPlots.Enabled = true;
verticalLines.Clear();
calculatedFrequencyCount = 0;
DidgeDesignProperties didgeProperties = didgePropertyEditor.DidgeDesignProperties;
Bore bore = new Bore(didgeProperties.BoreSections);
if (bore.Length == 0)
{
ShowError("The bore has a length of 0.");
return;
}
bore.CalculatedFrequency += new Bore.CalculatedFrequencyDelegate(bore_CalculatedFrequency);
DidgeData data = (DidgeData)treeDidgeHistory.SelectedNode.Tag;
data.didge = didgePropertyEditor.DidgeDesignProperties;
data.bore = bore;
finishedThreads = 0;
ParameterizedThreadStart threadStart = (threadNum) =>
{
//split the work up among however many threads we have
int startFrequency = (int)Math.Round((2000.0 / settings.NumberOfThreads) * ((int)threadNum) + 1.0, 0);
int endFrequency = (int)Math.Round((2000.0 / settings.NumberOfThreads) * ((int)threadNum + 1.0), 0);
bore.CalculateInputImpedance(startFrequency, endFrequency, 1);
SetImpedanceData();
};
for (int i=0; i<settings.NumberOfThreads; i++)
{
Thread thread = new Thread(threadStart);
thread.Start(i);
}
progressDialog = new Progress();
progressDialog.ShowDialog(this);
}