示例#1
0
        private void PlayerTrackingBackgroundWorkerProgressChanged(object sender, ProgressChangedEventArgs e)
        {
            if (e.ProgressPercentage < 0)
            {
                lblPlayerCoords.Text = "(?,?)";
                return;
            }

            PlayerLocation location = (PlayerLocation) e.UserState;
            if (m_LastKnownLocation.X == location.X && m_LastKnownLocation.Y == location.Y && m_LastKnownLocation.Facet == location.Facet)
            {
                // There has been no change in location.
                return;
            }

            m_LastKnownLocation = location;

            if (mapViewer.Map != location.Facet)
            {
                mapViewer.Map = location.Facet;
            }

            mapViewer.SetLocation(location.X, location.Y);

            lblPlayerCoords.Text = string.Concat('(', location.X, ',', location.Y, ')');
        }
示例#2
0
 private void imageProcessor_ProgressChanged(object sender, ProgressChangedEventArgs e)
 {
     progressBar.Style = ProgressBarStyle.Continuous;
     if (filters.Count > 0)
     {
         int percent = (loadedFilters * 10) + (e.ProgressPercentage * 10 / 100) * 100 / (totalFilters * 10);
         statusTxt.Text = "Loading filters... " + percent + "%";
         progressBar.Value = percent;
     }
     else
     {
         if (e.ProgressPercentage < 0)
         {
             progressBar.Value = 0;
         }
         else if (e.ProgressPercentage > 100)
         {
             progressBar.Value = 100;
         }
         else
         {
             progressBar.Value = e.ProgressPercentage;
         }
     }
 }
示例#3
0
 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
0
 void backgroundWorker1_ProgressChanged(object sender, ProgressChangedEventArgs e)
 {
     if (e.ProgressPercentage < this.progressBar1.Maximum)
     {
         this.progressBar1.Value = e.ProgressPercentage;
     }
 }
示例#5
0
 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));
 }
示例#6
0
        //public event EventHandler<AsyncPrototypeLoader.LoadResults> LoadComplete;
        //private PrefabWithDatabase _prefab;

        //public void LoadPrototypes(PrefabWithDatabase prefab)
        //{
        //    Visibility = System.Windows.Visibility.Visible;
        //    _prefab = prefab;
        //    prefab.LoadProgressChanged += new ProgressChangedEventHandler(LoadPtypes_ProgressChanged);
        //    prefab.LoadProgressComplete += new EventHandler<AsyncPrototypeLoader.LoadResults>(LoadPtypes_RunWorkerCompleted);
        //    prefab.LoadPtypesFromDBAsync();
        //}




        //private void LoadPtypes_RunWorkerCompleted(object sender, AsyncPrototypeLoader.LoadResults e)
        //{
        //    LoadProgress.Visibility = System.Windows.Visibility.Hidden;
        //    LoadProgressLabel.Visibility = System.Windows.Visibility.Hidden;
        //    if (LoadComplete != null)
        //    {
        //        LoadComplete(sender, e);
        //    }

        //    Visibility = System.Windows.Visibility.Hidden;
         
        //}

        private void LoadPtypes_ProgressChanged(object sender, ProgressChangedEventArgs e)
        {
            string state = e.UserState as string;
            switch (state)
            {
                case "prototypes":
                    LoadProgressLabel.Content = "Loading Prototypes...";
                    LoadProgress.IsIndeterminate = false;
                    LoadProgress.Minimum = 0;
                    LoadProgress.Maximum = 100;
                    LoadProgress.Value = e.ProgressPercentage;
                    break;

                case "rebuilding":
                    LoadProgress.IsIndeterminate = true;
                    LoadProgressLabel.Content = "Building data structures...";
                    break;

                case "connecting":
                    LoadProgress.IsIndeterminate = true;
                    LoadProgressLabel.Content = "Connecting to database...";
                    break;


                case "cancel":
                    Visibility = System.Windows.Visibility.Hidden;
                    break;

            }
        }
示例#7
0
      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;
      }
示例#8
0
        private void backgroundWorker1_ProgressChanged(object sender, ProgressChangedEventArgs e)
        {
            args arg = (args)e.UserState;
            var row = dataSetHistogram.tabKeywords.FindByKeyword(arg.keyword);
            if (row == null) {
                row = dataSetHistogram.tabKeywords.NewtabKeywordsRow();
                row.Keyword = arg.keyword;
                dataSetHistogram.tabKeywords.AddtabKeywordsRow(row);
            }

            row.BeginEdit();
            row.Keyword = arg.keyword;

            string cat2 = arg.category;
            if (cat2.Contains(" ")) {
                string[] xx = cat2.Split(' ');
                cat2 = xx[0];
            }
            cat2 = cat2 + "Hits";
            if (row.Table.Columns.Contains(cat2))
                row[cat2] = (int)row[cat2] + 1;
            else
                System.Diagnostics.Debug.WriteLine("Booh");

            row.EndEdit();
            row.AcceptChanges();
        }
示例#9
0
        //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()来接受
        }
 private void ScannerProgressChanged(object sender, ProgressChangedEventArgs e)
 {
     var state = (RepositoryScannerState)e.UserState;
     View.SetCurrentRepository(state.CurrentRepository);
     View.SetCurrentPath(state.CurrentPath);
     View.SetProgress(e.ProgressPercentage);
 }
示例#11
0
文件: Window.cs 项目: elkine/MASGAU
        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;
            }
        }
示例#12
0
 private void OnProcessingProgress(ProgressChangedEventArgs e)
 {
     if (Progress != null)
     {
         Progress(this, e);
     }
 }
示例#13
0
文件: Moe.cs 项目: saaadhu/Moe
 void ProgressChanged(object state, ProgressChangedEventArgs p)
 {
     if (p.ProgressPercentage == 100)
     {
         dte.Debugger.Stop(true);
     }
 }
示例#14
0
 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();
 }
示例#15
0
 private void Background_worker_infinit_Update_Queen(object sender, ProgressChangedEventArgs e)
 {
     if (top_fitness_ != e.ProgressPercentage) {
         top_fitness_ = e.ProgressPercentage;
         DrawQueens(genetic_algoithm_.GetTop() as NQueenGene);
     }
 }
示例#16
0
        private void Indexer_ProgressChanged(object sender, ProgressChangedEventArgs e)
        {
            DecodingProgress ip = (DecodingProgress)e.UserState;

            if (!String.IsNullOrEmpty(ip.Message))
            {
                textBox.AppendText(ip.Message + Environment.NewLine);
            }
            if (!String.IsNullOrEmpty(ip.ETA))
            {
                labelETA.Text = String.Format(Properties.Resources.ETA, ip.ETA);
            }

            if (e.ProgressPercentage > 0)
            {
                progressBar.Value = e.ProgressPercentage;
            }

            if (ip.DecodingState == DecodingProgress.State.Failure)
            {
                btnDone.Text = Properties.Resources.CloseIndexingForm;
            }

            if (ip.DecodingState == DecodingProgress.State.Finished)
            {
                indexingRunning = false;

                labelETA.Text = Properties.Resources.IndexingDoneETA;

                DialogResult = btnDone.Enabled ? DialogResult.OK : DialogResult.Abort;

                Close();
            }
        }
示例#17
0
 private void OnUploadProgressChanged(object sender, ProgressChangedEventArgs e)
 {
     if (ProgressChanged != null)
     {
         ProgressChanged(sender, e);
     }
 }
示例#18
0
 void downBackgroundWorker_ProgressChanged(object sender, ProgressChangedEventArgs e)
 {
     if (ProgressChanged != null)
     {
         ProgressChanged(e.ProgressPercentage);
     }
 }
 void OnWorkerProgressChanged(object sender, ProgressChangedEventArgs e)
 {
     if (this.EnsureProcessProgressChanged != null)
     {
         this.EnsureProcessProgressChanged(this, e);
     }
 }
示例#20
0
 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();
 }
示例#21
0
 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);
 }
示例#22
0
 void b1_ProgressChanged(object sender, ProgressChangedEventArgs b1)
 {
     TimeSpan t = TimeSpan.FromSeconds(b1.ProgressPercentage);
     string b1TimeFormatted = string.Format("{1:D2}:{2:D2}", t.Hours, t.Minutes, t.Seconds, t.Milliseconds);
     SetText(labelTimeText, b1TimeFormatted.ToString());
     this.CaptureInterface.DisplayInGameText(b1TimeFormatted.ToString());
 }
示例#23
0
        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;
            }
        }
    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;
    }
示例#25
0
		protected void ProgressChanged(object sender, ProgressChangedEventArgs e)
		{
			if (e.UserState is ProgressChangedArgs)
			{
				ProgressChangedArgs args = (ProgressChangedArgs)e.UserState;
				args.main.SetMaxProgress(args.maxProgress);
				if (args.header.Length > 0)
				{
					args.main.SetHeader(args.header);
				}
				if (args.message.Length > 0)
				{
					args.main.SetMessage(args.message);
				}
				if (e.ProgressPercentage < 0)
				{
					args.main.IncrementProgress();
				}
				else
				{
					args.main.SetProgress(e.ProgressPercentage);
				}
			}
			else if (e.UserState is Installer)
			{
				(e.UserState as Installer).IncrementProgress();
			}
			updating = false;
		}
示例#26
0
 private void bw_ProgressChanged(object sender, ProgressChangedEventArgs e)
 {
     if (FileCheckProgressChanged != null)
     {
         FileCheckProgressChanged((float)e.UserState);
     }
 }
示例#27
0
 protected virtual void OnExportProgressChanged(ProgressChangedEventArgs e)
 {
     if (ExportProgressChanged != null)
     {
         ExportProgressChanged(this, e);
     }
 }
示例#28
0
 private void backgroundWorker_ProgressChanged(object sender, ProgressChangedEventArgs e)
 {
     if (UploadFileProgressChangedToDo != null)
     {
         UploadFileProgressChangedToDo(null, new AltProgressChangedEventArgs(e.ProgressPercentage / 2));
     }
 }
示例#29
0
        private void backgroundWorker1_ProgressChanged(object sender, ProgressChangedEventArgs e)
        {
            curDiv += 1;

            string s = (string)e.UserState;
            label5.Text = curDiv.ToString() + " / " + divCount.ToString() + " : " +  s;
        }
        public void backgroundWorker1_ProgressChanged(object sender, ProgressChangedEventArgs e)
        {
            string con;
            if (e.ProgressPercentage == 1)
                button1.Enabled = true;

            if (checkBox1.Checked==true)
            {
                try
                {
                    transfer tr = (transfer)e.UserState;
                    con = tr.SourceDns + "     " + tr.DestDns + " " + tr.state + "\r\n";
                    textBox1.Text = textBox1.Text + con;
                }
                catch
                {
                    textBox1.Text = " ";
                }

            }
            else
            {
                try
                {
                    TcpConnectionInformation tcp = (TcpConnectionInformation)e.UserState;
                    con = tcp.LocalEndPoint + " : " +"  "+ tcp.RemoteEndPoint + "     " + tcp.State + "\r\n";
                    textBox1.Text = textBox1.Text + con;
                }
                catch
                {
                    textBox1.Text = " ";
                }
            }
        }
示例#31
0
 private void backgroundWorker1_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e)
 {
 }
示例#32
0
 private void BackgroundWorker1_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e)
 {
     pbStatus.Value = e.ProgressPercentage;
 }
 private void wkrCopia_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e)
 {
     //pd01.ShowDialog();
     //pd01.ReportProgress(e.ProgressPercentage, "Copia de archivos", e.UserState.ToString());
     pbFile.Value = e.ProgressPercentage;
 }
示例#34
0
 private void BackgroundWorker_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e)
 {
     //    tb3.Text = "Синхронизированно " + e.ProgressPercentage.ToString();// + ((vsegofiles - kolvozagr + e.ProgressPercentage).ToString() + " файлов из " + vsegofiles);
     //   pb1.Value = e.ProgressPercentage;
 }
示例#35
0
 private void backgroundWorker_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e)
 {
     progressBar.Value = e.ProgressPercentage;
 }
 /// <summary>
 /// A handler to event backgroundWorker.ReportProgress
 /// Accepts an Item as its argument
 /// </summary>
 /// <param name="sender">sender object</param>
 /// <param name="e">an Item</param>
 private void BackgroundWorker_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e)
 {
     this.mProgressBar.Value   = e.ProgressPercentage;
     this.mStatusLabel.Content = (string)e.UserState;
 }
示例#37
0
 private void transcribe_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e)
 {
     progressBar.Value = e.ProgressPercentage;
 }
示例#38
0
 private void Downloader_ChangeProgress(object sender, System.ComponentModel.ProgressChangedEventArgs e)
 {
     // when download file was changed
     // 20%, 30%, 80%, ...
     Console.WriteLine("{0}%", e.ProgressPercentage);
 }
示例#39
0
 private void deviceSearcher_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e)
 {
     this.RaiseProgressChangeEvent(new UploadMgrProgressChangedEventArgs("Поиск контроллера...", e.ProgressPercentage));
 }
示例#40
0
 // The ProgressChanged event is raised by the DoWork method.
 // This event handler does work that is internal to the
 // control. In this case, the text is toggled between its
 // light and dark state, and the control is told to
 // repaint itself.
 private void backgroundWorker1_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e)
 {
     this.isLit = !this.isLit;
     this.Refresh();
 }
示例#41
0
 private void BackgroundWorker_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e)
 {
     tb3.Content = "Синхронизированно " + e.ProgressPercentage.ToString() + " из " + vsegofiles.ToString();
     pb1.Value   = e.ProgressPercentage;
 }
示例#42
0
 // Запускается при измении прогресса вызов worker.ReportProgress(1,"Бот стартовал");
 private void BackgroundWorker_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e)
 {
     //Изменение прогесса
     AddMessageList((String)e.UserState);
     refreshLogTextList();
 }
示例#43
0
 /// -----------------------------------
 /// Method for updating the progressbar
 /// -----------------------------------
 private void BGWorker_Loading_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e) // Method ran the the change in the backgroundWorker progress
 {                                                                                                              // ----------------------------------------------------------
     Circle_Loading.Text  = Convert.ToString(e.ProgressPercentage) + "%";
     Circle_Loading.Value = e.ProgressPercentage;                                                               // Set the progressbar to the percentage completion of the backgroundWorker.
 }
示例#44
0
 private void backgroundWorker_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e)
 {
     progressBar.Value = e.ProgressPercentage;
     statusLabel.Text  = e.UserState as string;
 }
 /// <summary>
 /// Load progress shown in bar
 /// </summary>
 private void Content_LoadProgressChange(object sender, System.ComponentModel.ProgressChangedEventArgs e)
 {
     UpdateProgressSafe(e.ProgressPercentage, "Loading " + this.contentType.Description() + "s " + (string)e.UserState, e.ProgressPercentage < 100);
 }
示例#46
0
 private void backgroundWorker1_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e)
 {
     //string t = (string)e.UserState;
     //Console.WriteLine(t);
     this.lblNumEvts.Text = "Packets = " + e.ProgressPercentage.ToString();
 }
示例#47
0
 private void bwTicket_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e)
 {
     pbTicket.Value = e.ProgressPercentage;
 }
 private void ReportProgress(object sender, System.ComponentModel.ProgressChangedEventArgs e)
 {
     pbar.Value = (int)(((float)e.ProgressPercentage / (float)images.Count) * 100.0f);
 }
示例#49
0
 private void DataOutText_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e)
 {
 }
 private void backgroundWorker_CountRowsProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e)
 {
     StatusLabel.Text = "Counting rows... " + ToKMB((ulong)e.ProgressPercentage) + " thus far...";
 }
示例#51
0
        /// <summary>
        /// Eventhandler für Nachrichtenempfang im BackgroundWorker
        /// </summary>
        /// <param name="sender">BackgroundWorker</param>
        /// <param name="e">Enthält den UserState in Form eine ServerBackgroundWorkerProgress-Objekts,
        /// welches wiederum die empfangene Nachricht enthält</param>
        protected override void serverBackgroundWorker_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e)
        {
            // UserState in ServerBackgroundWorkerProgress casten
            ServerBackgroundWorkerProgress progress = e.UserState as ServerBackgroundWorkerProgress;

            // Nachricht an jeden registrierten Host weiterleiten
            foreach (ChatConnection connection in clientList)
            {
                try
                {
                    // Nachricht senden, wird nicht entschlüsselt
                    ChatClient cc = new ChatClient(connection);
                    cc.Send(new ChatMessage(progress.Data, ""));
                }
                catch (Exception)
                {
                    // Falls nicht erreichbar, Host aus
                    // der Liste löschen
                    RemoveClient(progress.Endpoint);
                }
            }
        }
示例#52
0
 private void worker_ProgressChanged(object sender,
                                     System.ComponentModel.ProgressChangedEventArgs e)
 {
 }
示例#53
0
 void backgroundWorkerSearch_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e)
 {
     return;
 }
示例#54
0
 private void Loading_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e)
 {
     LoadProgressLine.Value = e.ProgressPercentage;
 }
 private void backgroundWorker1_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e)
 {
     progressBar1.Value = e.ProgressPercentage;
     label3.Text        = e.ProgressPercentage.ToString() + "% completed";
 }
示例#56
0
 void parseWorker_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e)
 {
     this.progressBar1.Value = e.ProgressPercentage;
 }
示例#57
0
 private void backgroundWorker1_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e)
 {
     progressbar1.Visible          = true;
     progressbar1.Text             = "Computing results (" + e.ProgressPercentage + "%)";
     progressbar1.Adjustment.Value = e.ProgressPercentage;
 }
示例#58
0
 private void keyMonitorThread_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e)
 {
 }
示例#59
0
 //UI更新方法
 private void backgroundWorker1_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e)
 {
     this.txtZLocation.Text = e.UserState.ToString();
 }
示例#60
0
 private void backgroundWorker1_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e)
 {
     this.lblProgress.Text   = "%" + e.ProgressPercentage;
     this.progressBar1.Value = e.ProgressPercentage;
 }