当前位置: 首页>>代码示例>>C#>>正文


C# Progress.ShowDialog方法代码示例

本文整理汇总了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);
            }
        }
开发者ID:umar-qureshi2,项目名称:UG-Courses,代码行数:35,代码来源:LanLobby.cs

示例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();
 }
开发者ID:TaskTracker,项目名称:TaskTracker,代码行数:9,代码来源:Tasks.xaml.cs

示例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();
            }
        }
开发者ID:OlegBoulanov,项目名称:s3e,代码行数:14,代码来源:Progress.cs

示例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  
                //////////////////////////////////////////////////////////////////////////////////
//.........这里部分代码省略.........
开发者ID:SJMakin,项目名称:Randoop.NET,代码行数:101,代码来源:randoopCommand.cs

示例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();
        }
开发者ID:LantisEscudo,项目名称:VMXChecker-Win32,代码行数:38,代码来源:MainForm.cs

示例6: Compare

        private void Compare()
        {
            SetStatusWorking();

            _eltl.Reset();
            traceViewer1.Clear();

            _progress = new Progress();
            backgroundWorker1.RunWorkerAsync();
            _progress.ShowDialog(this);
        }
开发者ID:redoz,项目名称:bitdiffer,代码行数:11,代码来源:MainFrm.cs

示例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);
            }
        }
开发者ID:kanbang,项目名称:Colt,代码行数:95,代码来源:SetupRun.cs

示例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();
        }
开发者ID:dbremner,项目名称:ScreenToGif,代码行数:17,代码来源:Modern.cs

示例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);
		}
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:7,代码来源:Form1.cs

示例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();
            }
        }
开发者ID:mammo,项目名称:LukeSharp,代码行数:38,代码来源:DocumentsTabPage.cs

示例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);
开发者ID:kanbang,项目名称:Colt,代码行数:67,代码来源:Program.cs

示例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);
        }
开发者ID:JesusFreke,项目名称:didjimp,代码行数:48,代码来源:DidjImp.cs


注:本文中的Progress.ShowDialog方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。