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


C# ProgressBar.Refresh方法代码示例

本文整理汇总了C#中System.Windows.Forms.ProgressBar.Refresh方法的典型用法代码示例。如果您正苦于以下问题:C# ProgressBar.Refresh方法的具体用法?C# ProgressBar.Refresh怎么用?C# ProgressBar.Refresh使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Forms.ProgressBar的用法示例。


在下文中一共展示了ProgressBar.Refresh方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetProgressBar

        public void SetProgressBar(ProgressBar progressBar)
        {
            progressBar.Value = 0;
            int count = 0;
            foreach(ToDoDetails CurrentToDoDetails in ToDoDetails)
            {
                if (CurrentToDoDetails.Done == true)
                    count++;

            }
            double score = 100 * count / ToDoDetails.Count;
            int z;
            if (score>0)
            progressBar.Value = (int)score;
            progressBar.Refresh();
        }
开发者ID:Gitesss,项目名称:ToDo,代码行数:16,代码来源:ToDo.cs

示例2: writeProgess

 internal void writeProgess(ProgressBar progressBar)
 {
     progressBar.Refresh();
     using (Graphics gr = progressBar.CreateGraphics())
     {
         String s = progressBar.Value.ToString() + "/" + progressBar.Maximum.ToString();
         gr.DrawString(s,
             SystemFonts.DefaultFont,
             Brushes.Black,
             new PointF(progressBar.Width / 2 - (gr.MeasureString(s,
                 SystemFonts.DefaultFont).Width / 2.0F),
             progressBar.Height / 2 - (gr.MeasureString(s,
                 SystemFonts.DefaultFont).Height / 2.0F)));
     }
     //progressBar.Refresh();
     //progressBar.CreateGraphics().DrawString(progressBar.Value.ToString() + "/" +  progressBar.Maximum.ToString(), new Font("Arial", (float)8.25, FontStyle.Regular), Brushes.Black, new PointF(progressBar.Width / 2 - 10, progressBar.Height / 2 - 7));
 }
开发者ID:karlblum,项目名称:FrequentBraker,代码行数:17,代码来源:MainForm.cs

示例3: SaveToDisk

		/// <summary>
		/// Saves a wz file to the disk, AKA repacking.
		/// </summary>
		/// <param name="path">Path to the output wz file</param>
        /// <param name="progressBar">Progressbar, optional. (Set to null if not in use)</param>
		public void SaveToDisk(string path, ProgressBar progressBar)
		{
            WzIv = WzTool.GetIvByMapleVersion(mapleVersion);
			CreateVersionHash();
			wzDir.SetHash(versionHash);
            if (progressBar != null) { progressBar.PerformStep(); progressBar.Refresh(); } //30%
			string tempFile = Path.GetFileNameWithoutExtension(path) + ".TEMP";
			File.Create(tempFile).Close();
			wzDir.GenerateDataFile(tempFile);
			WzTool.StringCache.Clear();
            if (progressBar != null) { progressBar.PerformStep(); progressBar.Refresh(); } //40%
			uint totalLen = wzDir.GetImgOffsets(wzDir.GetOffsets(Header.FStart + 2));
			WzBinaryWriter wzWriter = new WzBinaryWriter(File.Create(path), WzIv);
			wzWriter.Hash = (uint)versionHash;
			Header.FSize = totalLen - Header.FStart;
			for (int i = 0; i < 4; i++)
				wzWriter.Write((byte)Header.Ident[i]);
            if (progressBar != null) { progressBar.PerformStep(); progressBar.Refresh(); } //50%
			wzWriter.Write((long)Header.FSize);
			wzWriter.Write(Header.FStart);
			wzWriter.WriteNullTerminatedString(Header.Copyright);
            if (progressBar != null) { progressBar.PerformStep(); progressBar.Refresh(); } //60%
			long extraHeaderLength = Header.FStart - wzWriter.BaseStream.Position;
			if (extraHeaderLength > 0)
			{
				wzWriter.Write(new byte[(int)extraHeaderLength]);
			}
            if (progressBar != null) { progressBar.PerformStep(); progressBar.Refresh(); } //70%
			wzWriter.Write(version);
			wzWriter.Header = Header;
			wzDir.SaveDirectory(wzWriter);
			wzWriter.StringCache.Clear();
			FileStream fs = File.OpenRead(tempFile);
			wzDir.SaveImages(wzWriter, fs);
			fs.Close();
            if (progressBar != null) { progressBar.PerformStep(); progressBar.Refresh(); } //80%
			File.Delete(tempFile);
			wzWriter.StringCache.Clear();
			wzWriter.Close();
            if (progressBar != null) { progressBar.PerformStep(); progressBar.Refresh(); } //90%
            GC.Collect();
            GC.WaitForPendingFinalizers();
		}
开发者ID:ilvmoney,项目名称:hasuite-new,代码行数:48,代码来源:WzFile.cs

示例4: migrateTerraserverFiles

        public static bool migrateTerraserverFiles(Form form, Label progressLabel, ProgressBar progressBar)
        {
            bool success = false;
            try
            {
                Cursor.Current = Cursors.WaitCursor;

                string folderName = GetTerraserverMapsBasePath();

                DirectoryInfo di = new DirectoryInfo(folderName);

                //			Hashtable folders = new Hashtable();

                FileInfo[] allfiles = di.GetFiles("*.jpg");
                double toMigrate = (double)allfiles.Length;

                progressBar.Minimum = 0;
                progressBar.Maximum = 100;

                int progressBarValue = 0;
                int lastProgressBarValue = progressBar.Value;

                int count = 0;
                DateTime started = DateTime.Now;
                string timeLeftStr = "";
                progressLabel.Text = "working...";
                foreach(FileInfo fi in allfiles)
                {
                    string hash = makeTsHash(fi.Name);
            //				if(folders.Contains(hash))
            //				{
            //					int count = (int)folders[hash];
            //					count++;
            //					folders[hash] = count;
            //				}
            //				else
            //				{
            //					folders.Add(hash, 1);
            //				}
                    string newFolderName = Path.Combine(folderName, hash);
                    if(!Directory.Exists(newFolderName))
                    {
                        Directory.CreateDirectory(newFolderName);
                    }

                    string oldPath = Path.Combine(folderName, fi.Name);
                    string newPath = Path.Combine(newFolderName, fi.Name);

                    if(File.Exists(newPath))
                    {
                        // no need to move, just delete the old location
                        File.Delete(oldPath);
                    }
                    else
                    {
                        File.Move(oldPath, newPath);
                    }
            //					Thread.Sleep(10);

                    count++;
                    double percentComplete = ((double)count) * 100.0d / toMigrate;
                    progressBarValue = (int)Math.Floor(percentComplete);

                    if(count % 50 == 0)
                    {
                        progressLabel.Text = fi.Name + timeLeftStr;
                        progressLabel.Refresh();
                        Cursor.Current = Cursors.WaitCursor;
                    }

                    if(progressBarValue != lastProgressBarValue)
                    {
                        progressBar.Value = progressBarValue;
                        progressBar.Refresh();
                        lastProgressBarValue = progressBarValue;

                        TimeSpan elapsed = DateTime.Now - started;
                        TimeSpan projected = new TimeSpan((long)(((double)elapsed.Ticks) / ((double)percentComplete) * 100.0d));
                        TimeSpan left = projected - elapsed;
                        timeLeftStr = "    (" + left.Minutes + " min. " + left.Seconds + " sec. left)";

                        progressLabel.Text = fi.Name + timeLeftStr;
                        progressLabel.Refresh();

                    }
                }

                progressLabel.Text = "Done";
                success = true;

            //			System.Console.WriteLine("Hashtable count: " + folders.Count);
            //			foreach(string key in folders.Keys)
            //			{
            //				System.Console.WriteLine("" + key + " : " + folders[key]);
            //			}
            }
            catch (Exception exc)
            {
                Project.MessageBox(form, "Error: " + exc.Message);
                progressLabel.Text = "Error: " + exc.Message;
//.........这里部分代码省略.........
开发者ID:slgrobotics,项目名称:QuakeMap,代码行数:101,代码来源:Project.cs

示例5: GeneraArchivoTxT

        public static void GeneraArchivoTxT(string nomArchi, DataTable dt, char Separador, ref ProgressBar progresBar1, ref Label lblQueHacemos)
        {
            string cadena = null;
            cadena = null;
            for (int i = 0; i < dt.Rows.Count; i++)
            {

                Application.DoEvents();
                for (int j = 0; j < dt.Columns.Count; j++)
                {
                    cadena = cadena + dt.Rows[i][j].ToString().Trim() + Separador;
                    Application.DoEvents();

                    if ((i % 7) == 0)
                    {
                        progresBar1.Value = i;
                        progresBar1.Refresh();
                        Application.DoEvents();
                    }
                }
                grabaArchivoTexto(nomArchi, cadena, true);
                cadena = null;
            }
        }
开发者ID:hvivani,项目名称:SOffT,代码行数:24,代码来源:DatosArchivoTexto.cs

示例6: Initiate_Torrent_Ranking_Analizes

        private void Initiate_Torrent_Ranking_Analizes(int tabPage2GoBack, int x, int y, int w, Control parentControl, string preSearch = "")
        {
            int nOfWebPagesToCollect = 20; //number of pages to collect from indexer site (below)
            System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;

            if (!Parameters.torrentPageAlreadyExtrated) //within same session no need to repopulate listview
            {

                string codHtmlRanking = "";
                string rankingWeekFileName = Path.Combine(Parameters.myProgPath + "\\Ranking", "Week" + Parameters.weekOfTheYear(DateTime.Today).ToString("00") + ".txt");
                string defaultFileName = Path.Combine(Parameters.myProgPath + "\\Ranking", "Ranking" + ".txt");
                if (File.Exists(rankingWeekFileName))  //within same week. is gonna use week file.
                {
                    codHtmlRanking = File.ReadAllText(rankingWeekFileName);
                }

                else if (File.Exists(defaultFileName))
                {
                    DialogResult dr;
                    dr = MessageBox.Show(@"The Ranking Data is Old. You Can Get New Data or Use the Old one.
            Do you Want Get New Data From Web? Is going to take Some Time.", "Ranking Data File is Old", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
                    if (DialogResult.No == dr)
                    {
                        codHtmlRanking = File.ReadAllText(defaultFileName);
                    }
                    else if (DialogResult.Cancel == dr) { return; }
                }
                else
                {
                    DialogResult dr;
                    dr = MessageBox.Show(@"The Torrent Ranking Data is Gotten from the Web and Takes Some Time (about 2 minutes). Want to Continue?", "New Ranking Data is Required", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                    if (DialogResult.No == dr)
                    {
                        return;
                    }

                }
                this.progressBar_Ranking = new System.Windows.Forms.ProgressBar();

                //
                // progressBar_Ranking
                //
                this.progressBar_Ranking.BackColor = System.Drawing.Color.DarkGray;
                this.progressBar_Ranking.ForeColor = System.Drawing.Color.Lime;

                this.progressBar_Ranking.Location = new System.Drawing.Point(x + 4, y - 11);
                //button_Ranking.Top = buttonOK.Top;
                //buttonCancel.Left = buttonOK.Right + 5;
                //buttonCancel.Width = buttonOK.Width;
                //buttonCancel.Height = buttonOK.Height;
                this.progressBar_Ranking.Step = 1;
                this.progressBar_Ranking.Name = "progressBar_Ranking";
                this.progressBar_Ranking.Size = new System.Drawing.Size(w - 10, 7);
                this.progressBar_Ranking.Style = System.Windows.Forms.ProgressBarStyle.Continuous;
                this.progressBar_Ranking.TabIndex = 22;

                parentControl.Controls.Add(this.progressBar_Ranking);

                this.progressBar_Ranking.Maximum = nOfWebPagesToCollect + 5;
                this.progressBar_Ranking.BringToFront();
                this.progressBar_Ranking.Refresh();
                Thread.Sleep(200);

                if (codHtmlRanking == "") //new data has been required
                {
                    codHtmlRanking += CodHtmlTvTorrentsPageCodeExtractor(0);  //maybe turn this in a backgroundworker
                    if (codHtmlRanking == "#off-line#")
                    {
                        MessageBox.Show("Sorry, WebSite or Internet is off-line. Going to Use old Data if available. Try Again Late");

                    }
                    else
                    {

                        for (int i = 1; i <= nOfWebPagesToCollect; i++)
                        {
                            codHtmlRanking += CodHtmlTvTorrentsPageCodeExtractor(i);  //maybe turn this in a backgroundworker
                            progressBar_Ranking.Value = i;
                            progressBar_Ranking.Refresh();

                        }
                        SaveCodhtmlRanking(codHtmlRanking);
                    }

                }

                Torrent_Ranking_Extractor(codHtmlRanking);
            }

            Thread.Sleep(250);

            label_TP7_Ranking.Text = "Torrent Ranking. Top " + listView_TorrentRanking.Items.Count.ToString() + " Shows.";
            tabControl1.SelectedIndex = 6;
            listView_TorrentRanking.Refresh();
            listView_TorrentRanking.Select();
            if (preSearch != "")
            { //try to find listbox show name in rankinglistview.
                this.listView_TorrentRanking.EnsureVisible(0);
                preSearch = Parameters.ClearStr(preSearch).Replace("'", "").Replace(".", " ").Replace("&", "and").Trim();
//.........这里部分代码省略.........
开发者ID:leopacman,项目名称:MyTvShowOrganizer,代码行数:101,代码来源:Form1_Main.cs

示例7: SetValue4Prg

 private void SetValue4Prg(ProgressBar Prg, int _Value)
 {
     try
     {
         if (Prg.InvokeRequired)
         {
             Prg.Invoke(new SetPrgValue(SetValue4Prg), new object[] {Prg, _Value});
         }
         else
         {
             if (Prg.Value + _Value <= Prg.Maximum) Prg.Value += _Value;
             Prg.Refresh();
         }
     }
     catch
     {
     }
 }
开发者ID:khaha2210,项目名称:CodeNewTeam,代码行数:18,代码来源:frmImportExcel.cs

示例8: GetNeuroData

 void GetNeuroData()
 {
     Form frm = new Form();
     ProgressBar pb = new ProgressBar();
     frm.Controls.Add(pb);
     frm.Width = 300;
     frm.Height = 50;
     frm.TopMost = true;
     frm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
     pb.Visible = true;
     pb.Maximum = NNH.Signes.Count;
     pb.Value = 0;
     pb.Height = 50;
     pb.Dock = DockStyle.Fill;
     pb.Invalidate();
     Application.DoEvents();
     frm.Show();
     int n = 0;
     for (int i = 0; i < NNH.Signes.Count ; i++)
     {
         if (i%5==0)
         {
             pb.Value = n;
             pb.Refresh();
             frm.Invalidate();
             Application.DoEvents();
         }
         if (NNH.Signes[i].Spectr == null)
         {
             NNH.Signes[i].Spectr = (GetDoubAr(SpecA.GetRawSpectrData(NNH.Signes[i].filepath, BassGetSpectrum.Spectrum.FFTSize.FFT1024, 30, 10000)));
         }
         var item = NNH.Signes[i];
         NNH.GetNeuroData(ref item);
         NNH.Signes[i].NeuroDays = item.NeuroDays;
         NNH.Signes[i].NeuroHours = item.NeuroHours;
         n++;
     }
     frm.Close();
 }
开发者ID:jorik041,项目名称:Athena-NeuroPlay,代码行数:39,代码来源:AthenaPlayerForm1.cs

示例9: GetAllSignes

 void GetAllSignes()
 {
     Form frm = new Form();
     ProgressBar pb = new ProgressBar();
     frm.Controls.Add(pb);
     frm.Width = 200;
     frm.Height = 50;
     frm.TopMost = true;
     frm.Show();
     frm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
     pb.Visible = true;
     pb.Dock = DockStyle.Fill;
     pb.Maximum = listBox1b.Items.Count ;
     pb.Value = 0;
     int n = 0;
     foreach (var item in listBox1b.Items)
     {
         pb.Value = n;
         frm.Invalidate();
         Application.DoEvents();
         pb.Refresh();
         Application.DoEvents();
         NNH.GetBaseSign((string)item);
         n++;
     }
     frm.Close();
 }
开发者ID:jorik041,项目名称:Athena-NeuroPlay,代码行数:27,代码来源:AthenaPlayerForm1.cs

示例10: BuscaRetorno

        public string BuscaRetorno(tcIdentificacaoPrestador Prestador, KryptonLabel lblStatus, ProgressBar ProgresStatus)
        {

            bool parar = false;
            Globais glob = new Globais();
            string sMensagemErro = "";
            int iCountBuscaRet = 0;

            ProgresStatus.Step = 1;
            ProgresStatus.Minimum = 0;
            ProgresStatus.Maximum = 20;
            ProgresStatus.MarqueeAnimationSpeed = 20;
            ProgresStatus.Value = 0;

            try
            {
                for (; ; )
                {
                    ProgresStatus.PerformStep();
                    ProgresStatus.Refresh();
                    lblStatus.Text = "Sistema tentando buscar retorno!!" + Environment.NewLine + "Tentativas: " + iCountBuscaRet.ToString() + " de 21";
                    lblStatus.Refresh();
                    string sRetConsulta = BuscaRetornoWebService(Prestador);
                    XmlDocument xmlRet = new XmlDocument();
                    xmlRet.LoadXml(sRetConsulta);

                    XmlNodeList xNodeList = xmlRet.GetElementsByTagName("ns4:MensagemRetorno");

                    if (xNodeList.Count > 0)
                    {
                        sMensagemErro = "{3}Lote: " + NumeroLote + "{3}{3}Código: {0}{3}{3}Mensagem: {1}{3}{3}Correção: {2}{3}{3}Protocolo: " + Protocolo;

                        foreach (XmlNode node in xNodeList)
                        {
                            sCodigoRetorno = node["ns4:Codigo"].InnerText;

                            if (sCodigoRetorno.Equals("E4") && iCountBuscaRet <= 20)
                            {
                                iCountBuscaRet++;
                            }
                            else
                            {
                                sMensagemErro = string.Format(sMensagemErro, node["ns4:Codigo"].InnerText,
                                                      "Esse RPS ainda não se encontra em nossa base de dados.",
                                                      node["ns4:Correcao"].InnerText, Environment.NewLine);
                                parar = true;
                            }
                        }
                    }
                    else if (xmlRet.GetElementsByTagName("ns3:CompNfse").Count > 0)
                    {
                        this.sCodigoRetorno = "";
                        sMensagemErro = "";
                        Globais objGlobais = new Globais();
                        bool bAlteraDupl = Convert.ToBoolean(objGlobais.LeRegConfig("GravaNumNFseDupl"));


                        for (int i = 0; i < xmlRet.GetElementsByTagName("ns3:CompNfse").Count; i++)
                        {
                            #region Salva Arquivo por arquivo
                            string sPasta = Convert.ToDateTime(xmlRet.GetElementsByTagName("ns4:InfNfse")[i]["ns4:DataEmissao"].InnerText).ToString("MM/yy").Replace("/", "");
                            //Numero da nota no sefaz + numero da sequencia no sistema
                            string sNomeArquivo = sPasta + (xmlRet.GetElementsByTagName("ns4:InfNfse")[i]["ns4:Numero"].InnerText.PadLeft(6, '0'))
                                                 + (xmlRet.GetElementsByTagName("ns4:IdentificacaoRps")[i]["ns4:Numero"].InnerText.PadLeft(6, '0'));

                            XmlDocument xmlSaveNfes = new XmlDocument();
                            xmlSaveNfes.LoadXml(xmlRet.GetElementsByTagName("ns4:Nfse")[i].InnerXml);
                            DirectoryInfo dPastaData = new DirectoryInfo(belStaticPastas.ENVIADOS + "\\Servicos\\" + sPasta);
                            if (!dPastaData.Exists) { dPastaData.Create(); }
                            xmlSaveNfes.Save(belStaticPastas.ENVIADOS + "\\Servicos\\" + sPasta + "\\" + sNomeArquivo + "-nfes.xml");
                            #endregion

                            objNfseRetorno = new TcInfNfse();
                            objNfseRetorno.Numero = xmlRet.GetElementsByTagName("ns4:InfNfse")[i]["ns4:Numero"].InnerText;
                            objNfseRetorno.CodigoVerificacao = xmlRet.GetElementsByTagName("ns4:InfNfse")[i]["ns4:CodigoVerificacao"].InnerText;

                            tcIdentificacaoRps objIdentRps = BuscatcIdentificacaoRps(xmlRet.GetElementsByTagName("ns4:IdentificacaoRps")[i]["ns4:Numero"].InnerText.PadLeft(6, '0'));
                            belGerarXML objBelGeraXml = new belGerarXML();


                            if (belStatic.sNomeEmpresa == "LORENZON")
                            {
                                AlteraDuplicataNumNFse(objIdentRps, xmlRet.GetElementsByTagName("ns4:InfNfse")[i]["ns4:Numero"].InnerText);
                            }

                            if (xmlRet.GetElementsByTagName("ns4:SubstituicaoNfse")[i] != null)
                            {
                                objNfseRetorno.NfseSubstituida = xmlRet.GetElementsByTagName("ns4:SubstituicaoNfse")[i]["ns4:NfseSubstituidora"].InnerText;
                            }
                            objNfseRetorno.IdentificacaoRps = objIdentRps;
                            objListaNfseRetorno.Add(objNfseRetorno);

                        }
                        parar = true;
                    }

                    if (parar) break;
                }
                return sMensagemErro;

//.........这里部分代码省略.........
开发者ID:dramosti,项目名称:GeraXml_2.0,代码行数:101,代码来源:belRecepcao.cs

示例11: recalcMatches

        public static void recalcMatches(List<Person> playerList, List<Match> matchList, Double startMu, Double startSigma, Double multiplier, UInt16 decay, UInt32 decayValue, DateTime lastDate, ProgressBar progress)
        {
            lastDate += new TimeSpan(23, 59, 59);

            Dictionary<String, Person> playerMap = new Dictionary<string, Person>();
            DateTime latestMatch = DateTime.MinValue;
            int matchTotal = matchList.Count;
            int counted = 0;
            if (progress != null)
            {
                progress.Value = 0;
                progress.Refresh();
            }

            foreach (Person person in playerList)
            {
                person.Mu = startMu;
                person.Sigma = startSigma;
                person.Wins = 0;
                person.Losses = 0;
                person.Draws = 0;
                person.Multiplier = multiplier;
                person.DecayDays = 0;
                person.DecayMonths = 0;

                playerMap.Add(person.Name, person);
            }

            foreach (Match match in matchList)
            {
                if (progress != null)
                {
                    counted++;
                    progress.Value = (counted * 100) / matchTotal;
                    progress.PerformStep();
                }

                if (match.Timestamp <= lastDate)
                {
                    Person p1 = playerMap[match.Player1];
                    Person p2 = playerMap[match.Player2];

                    if (decay > 0)
                    {
                        uint i = 0;
                        if (decay < 3)
                        {
                            while (p1.LastMatch.AddDays(i).CompareTo(match.Timestamp) < 0)
                            {
                                i++;
                            }
                            p1.DecayDays += i;
                            i = 0;
                            while (p2.LastMatch.AddDays(i).CompareTo(match.Timestamp) < 0)
                            {
                                i++;
                            }
                            p2.DecayDays += i;
                        }
                        else
                        {
                            i = 0;
                            while (p1.LastMatch.AddMonths((int)i).CompareTo(match.Timestamp) < 0)
                            {
                                i++;
                            }
                            p1.DecayMonths += i;
                            i = 0;
                            while (p2.LastMatch.AddMonths((int)i).CompareTo(match.Timestamp) < 0)
                            {
                                i++;
                            }
                            p2.DecayMonths += i;
                        }

                        switch (decay)
                        {
                            case 1:
                                while (p1.DecayDays > decayValue - 1)
                                {
                                    p1.decayScore(startSigma);
                                    p1.DecayDays -= decayValue;
                                }
                                while (p2.DecayDays > decayValue - 1)
                                {
                                    p2.decayScore(startSigma);
                                    p2.DecayDays -= decayValue;
                                }
                                break;
                            case 2:
                                while (p1.DecayDays > (7 * decayValue) - 1)
                                {
                                    p1.decayScore(startSigma);
                                    p1.DecayDays -= 7 * decayValue;
                                }
                                while (p2.DecayDays > (7 * decayValue) - 1)
                                {
                                    p2.decayScore(startSigma);
                                    p2.DecayDays -= 7 * decayValue;
                                }
//.........这里部分代码省略.........
开发者ID:zoharmodifier,项目名称:SkillKeeper,代码行数:101,代码来源:Toolbox.cs

示例12: UpdateProgess

 private void UpdateProgess(ProgressBar progBar, int percentComplete, Label progDetails, string message)
 {
     if (progDetails != null)
     {
         progDetails.Text = message;
         progDetails.Refresh();
     }
     if (progBar != null)
     {
         progBar.Value = percentComplete;
         progBar.Refresh();
     }
 }
开发者ID:westleyl,项目名称:DDDNorth2-AsyncPatterns,代码行数:13,代码来源:AsyncPatternsAndPractices.cs

示例13: BuscaRetorno

        public string BuscaRetorno(tcIdentificacaoPrestador Prestador, KryptonLabel lblStatus, ProgressBar ProgresStatus)
        {

            bool parar = false;
            string sMensagemErro = "";
            int iCountBuscaRet = 1;

            ProgresStatus.Step = 1;
            ProgresStatus.Minimum = 0;
            ProgresStatus.Maximum = 20;
            ProgresStatus.MarqueeAnimationSpeed = 20;
            ProgresStatus.Value = 0;

            try
            {
                for (; ; )
                {
                    ProgresStatus.PerformStep();
                    ProgresStatus.Refresh();
                    lblStatus.Text = "O Sistema está tentando buscar Retorno..." + Environment.NewLine + "Tentativa " + iCountBuscaRet.ToString() + " de 21";
                    lblStatus.Refresh();
                    string sRetConsulta = BuscaRetornoWebService(Prestador);
                    XmlDocument xmlRet = new XmlDocument();
                    xmlRet.LoadXml(sRetConsulta);

                    XmlNodeList xNodeList = xmlRet.GetElementsByTagName((Acesso.tipoWsNfse == Acesso.TP_WS_NFSE.GINFES ? "ns4:" : "") + "MensagemRetorno");

                    if (xNodeList.Count > 0)
                    {
                        sMensagemErro = "{3}Lote: " + NumeroLote + "{3}{3}Código: {0}{3}{3}Mensagem: {1}{3}{3}Correção: {2}{3}{3}Protocolo: " + Protocolo;

                        foreach (XmlNode node in xNodeList)
                        {
                            sCodigoRetorno = node[(Acesso.tipoWsNfse == Acesso.TP_WS_NFSE.GINFES ? "ns4:" : "") + "Codigo"].InnerText;

                            if (sCodigoRetorno.Equals("E4") && iCountBuscaRet <= 20)
                            {
                                iCountBuscaRet++;
                            }
                            else
                            {
                                sMensagemErro = string.Format(sMensagemErro, node[(Acesso.tipoWsNfse == Acesso.TP_WS_NFSE.GINFES ? "ns4:" : "") + "Codigo"].InnerText,
                                                      "Esse RPS ainda não se encontra em nossa base de dados.",
                                                      node[(Acesso.tipoWsNfse == Acesso.TP_WS_NFSE.GINFES ? "ns4:" : "") + "Correcao"].InnerText, Environment.NewLine);
                                parar = true;
                            }
                        }
                    }
                    else if (xmlRet.GetElementsByTagName((Acesso.tipoWsNfse == Acesso.TP_WS_NFSE.GINFES ? "ns3:" : "") + "CompNfse").Count > 0)
                    {
                        this.sCodigoRetorno = "";
                        sMensagemErro = "";
                        bool bAlteraDupl = Convert.ToBoolean(Acesso.GRAVA_NUM_NF_DUPL);


                        for (int i = 0; i < xmlRet.GetElementsByTagName((Acesso.tipoWsNfse == Acesso.TP_WS_NFSE.GINFES ? "ns3:" : "") + "CompNfse").Count; i++)
                        {
                            #region Salva Arquivo por arquivo
                            string sPasta = Convert.ToDateTime(xmlRet.GetElementsByTagName((Acesso.tipoWsNfse == Acesso.TP_WS_NFSE.GINFES ? "ns4:" : "") + "InfNfse")[i][(Acesso.tipoWsNfse == Acesso.TP_WS_NFSE.GINFES ? "ns4:" : "") + "DataEmissao"].InnerText).ToString("MM/yy").Replace("/", "");
                            //Numero da nota no sefaz + numero da sequencia no sistema
                            string sNomeArquivo = sPasta + (xmlRet.GetElementsByTagName((Acesso.tipoWsNfse == Acesso.TP_WS_NFSE.GINFES ? "ns4:" : "") + "InfNfse")[i][(Acesso.tipoWsNfse == Acesso.TP_WS_NFSE.GINFES ? "ns4:" : "") + "Numero"].InnerText.PadLeft(6, '0'))
                                                 + (xmlRet.GetElementsByTagName((Acesso.tipoWsNfse == Acesso.TP_WS_NFSE.GINFES ? "ns4:" : "") + "IdentificacaoRps")[i][(Acesso.tipoWsNfse == Acesso.TP_WS_NFSE.GINFES ? "ns4:" : "") + "Numero"].InnerText.PadLeft(6, '0'));

                            XmlDocument xmlSaveNfes = new XmlDocument();
                            xmlSaveNfes.LoadXml(xmlRet.GetElementsByTagName((Acesso.tipoWsNfse == Acesso.TP_WS_NFSE.GINFES ? "ns4:" : "") + "Nfse")[i].InnerXml);
                            DirectoryInfo dPastaData = new DirectoryInfo(Pastas.ENVIADOS + "\\Servicos\\" + sPasta);
                            if (!dPastaData.Exists) { dPastaData.Create(); }
                            xmlSaveNfes.Save(Pastas.ENVIADOS + "\\Servicos\\" + sPasta + "\\" + sNomeArquivo + "-nfes.xml");
                            #endregion

                            objNfseRetorno = new TcInfNfse();
                            objNfseRetorno.Numero = xmlRet.GetElementsByTagName((Acesso.tipoWsNfse == Acesso.TP_WS_NFSE.GINFES ? "ns4:" : "") + "InfNfse")[i][(Acesso.tipoWsNfse == Acesso.TP_WS_NFSE.GINFES ? "ns4:" : "") + "Numero"].InnerText;
                            objNfseRetorno.CodigoVerificacao = xmlRet.GetElementsByTagName((Acesso.tipoWsNfse == Acesso.TP_WS_NFSE.GINFES ? "ns4:" : "") + "InfNfse")[i][(Acesso.tipoWsNfse == Acesso.TP_WS_NFSE.GINFES ? "ns4:" : "") + "CodigoVerificacao"].InnerText;

                            tcIdentificacaoRps objIdentRps = BuscatcIdentificacaoRps(xmlRet.GetElementsByTagName((Acesso.tipoWsNfse == Acesso.TP_WS_NFSE.GINFES ? "ns4:" : "") + "IdentificacaoRps")[i][(Acesso.tipoWsNfse == Acesso.TP_WS_NFSE.GINFES ? "ns4:" : "") + "Numero"].InnerText.PadLeft(6, '0'));

                            string sNotaFis = xmlRet.GetElementsByTagName((Acesso.tipoWsNfse == Acesso.TP_WS_NFSE.GINFES ? "ns4:" : "") + "InfNfse")[i][(Acesso.tipoWsNfse == Acesso.TP_WS_NFSE.GINFES ? "ns4:" : "") + "Numero"].InnerText;
                            if (Acesso.NM_EMPRESA.Equals("LORENZON"))
                            {
                                AlteraDuplicataNumNFse(objIdentRps, sNotaFis);
                            }

                            if (Acesso.NM_EMPRESA.Equals("FORMINGP"))
                            {
                                daoDuplicata objdaodup = new daoDuplicata();
                                objdaodup.BuscaVencto(objIdentRps.Nfseq, sNotaFis, objIdentRps.Numero);
                            }

                            if (xmlRet.GetElementsByTagName((Acesso.tipoWsNfse == Acesso.TP_WS_NFSE.GINFES ? "ns4:" : "") + "SubstituicaoNfse")[i] != null)
                            {
                                objNfseRetorno.NfseSubstituida = xmlRet.GetElementsByTagName((Acesso.tipoWsNfse == Acesso.TP_WS_NFSE.GINFES ? "ns4:" : "") + "SubstituicaoNfse")[i][(Acesso.tipoWsNfse == Acesso.TP_WS_NFSE.GINFES ? "ns4:" : "") + "NfseSubstituidora"].InnerText;
                            }
                            objNfseRetorno.IdentificacaoRps = objIdentRps;
                            objListaNfseRetorno.Add(objNfseRetorno);

                        }
                        parar = true;
                    }

                    if (parar) break;
//.........这里部分代码省略.........
开发者ID:dramosti,项目名称:GeraXml_3.0,代码行数:101,代码来源:belRecepcao.cs


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