예제 #1
0
 private void ProgressBarCallBack(object state)
 {
     if (OnProgressBar != null)
     {
         ProgressBarEventArgs e = new ProgressBarEventArgs(_index, _max);
         OnProgressBar(this, e);
     }
 }
        private void OnRaiseProgressEvent(ProgressBarEventArgs e)
        {
            EventHandler <ProgressBarEventArgs> handler = ProgressEvent;

            if (handler != null)
            {
                //this is what actually raises the event.
                handler(null, e);
            }
        }
예제 #3
0
 private void StockpileProgressBarHandler(object source, ProgressBarEventArgs e)
 {
     SyncObjectSingleton.FormExecute(() =>
     {
         lbCurrentAction.Text = e.CurrentTask;
         if ((int)e.Progress > 100)
         {
             e.Progress = 100;
         }
         pbSave.Value = (int)e.Progress;
     });
 }
예제 #4
0
        private void NewBlockArrived(object sender, ProgressBarEventArgs e)
        {
            double fraction = 1.0 * (e.HighestIndex - e.CountCurrentBlocksInTranzit - e.ReducedBlocksCount) / (e.HighestIndex - e.ReducedBlocksCount);

            Dispatcher.Invoke(() =>
            {
                progBgLabel.Width = progBorder.Width * fraction;

                if (fraction != 1)
                {
                    progLabel.Content = "downloading... " + Math.Ceiling(100 * fraction) + "%";
                }

                else
                {
                    progLabel.Content = "synchronized";
                }
            });
        }
예제 #5
0
        private void UpdateProgressBarEvent(object sender, ProgressBarEventArgs e)
        {
            this.BeginInvoke((Action)(delegate
            {
                if (e.CurrentAction != null)
                {
                    this.lblStatus.Text = e.CurrentAction;
                }

                this.progressBar.Value = e.CurrentPercentage;

                if (e.IsCompleted)
                {
                    this.progressBar.Value = 100;
                    this.lblStatus.Text = "Subida Completa!";
                    this.btnCerrar.Text = "Cerrar";
                }
            }));
        }
예제 #6
0
        public static void RaiseProgress(object sender, ProgressBarEventArgs args)
        {
            var evt = OnProgress;

            evt?.Invoke(sender, args);
        }
예제 #7
0
 void Database_OnProgressBarInitialized(object sender, ProgressBarEventArgs e)
 {
     TotalGames = e.TotalGames;
 }
 void pgn_OnProgressBarInitialized(object sender, ProgressBarEventArgs e)
 {
     totalGamesCount = e.TotalGames;
 }
예제 #9
0
 private static void OnRaiseProgressEvent(ProgressBarEventArgs e)
 {
     EventHandler<ProgressBarEventArgs> handler = ProgressEvent;
     if (handler != null)
     {
         //this is what actually raises the event.
         handler(null, e);
     }
 }
예제 #10
0
 private void CardCriteriaRepository_ProgressEventHandler(object sender, ProgressBarEventArgs e)
 {
     _bar.Maximum = e.Maximum;
     _bar.Value  += e.Progress;
 }
예제 #11
0
 private void SqlManager_ProgressEvent(object sender, ProgressBarEventArgs e)
 {
     _bar.Maximum = e.Maximum;
     _bar.Value  += e.Progress;
 }