void OnImportProgressChanged(object sender, ProgressChangedArgs args)
        {
            switch (args.ImportStatus)
            {
            case ProgressStatus.Starting:
                var step = args.TotalItems > 0 ? 100 / args.TotalItems : 0;
                Invoke((Action)(() => progressBar1.Step = step));
                break;

            case ProgressStatus.Processing:
                Invoke((Action)(() => progressBar1.PerformStep()));
                break;

            case ProgressStatus.Completed:
                Invoke((Action)(() => progressBar1.Value = 100));
                Invoke((Action)(() => btnImport.Text = "Start Import"));
                Application.DoEvents();
                break;
            }

            Invoke((Action)(() => progressBar1.Text = args.ProgressMessage));

            if (!string.IsNullOrEmpty(args.ErrorMessage))
            {
                Invoke((Action)(() => MessageBox.Show(args.ErrorMessage, "Error", MessageBoxButtons.OK)));
            }
        }
        internal void InvokeOnProgressChanged(ProgressChangedArgs args)
        {
            var handler = OnProgressChanged;

            if (handler != null)
            {
                handler(this, args);
            }
        }
示例#3
0
        private void OnProgressChanged(IntPtr converter)
        {
            var eventArgs = new ProgressChangedArgs
            {
                Document    = _processingDocument,
                Description = _wkHtmlToPdf.GetProgressString(converter)
            };

            ProgressChanged?.Invoke(this, eventArgs);
        }
        private void OnProgressChanged(IntPtr converter)
        {
            var eventArgs = new ProgressChangedArgs()
            {
                Document    = ProcessingDocument,
                Description = Tools.GetProgressString(converter)
            };

            ProgressChanged?.Invoke(this, eventArgs);
        }
示例#5
0
 void writer_ProgressChanged(object sender, ProgressChangedArgs e)
 {
     if (e.Progress >= 0 && e.Progress <= 100)
     {
         SetProgress(e.Progress);
     }
     if (!string.IsNullOrWhiteSpace(e.Msg))
     {
         AppendText(e.Msg);
     }
 }
示例#6
0
 protected void OnProgressChanged(ProgressChangedArgs e)
 {
     if (ProgressChanged != null)
     {
         ProgressChanged(this, e);
     }
     else
     {
         // do not know what to do;
     }
 }
示例#7
0
        private void BgWorker_ProgressChanged(object sender, ProgressChangedEventArgs e)
        {
            progressBar1.Value = e.ProgressPercentage;

            ProgressChangedArgs args = (ProgressChangedArgs)e.UserState;

            infoLbl.Text = LangManager.GetString("progressionLbl") + " " + e.ProgressPercentage.ToString() + "% - " + args.State;

            if (args.ProcessingPath != "")
            {
                infoLbl.Text += Environment.NewLine + LangManager.GetString("processingLbl") + " " + args.ProcessingPath;
            }
        }
示例#8
0
 private void Progressable_ProgressChanged(object sender, ProgressChangedArgs e)
 {
     if (Visible)
     {
         Invoke((MethodInvoker) delegate {
             if (progressBar_Progress.Value == e.Progress)
             {
                 return;
             }
             if (e.Progress < 100)
             {
                 progressBar_Progress.Value = e.Progress + 1;
             }
             progressBar_Progress.Value = e.Progress;
         });
     }
 }
示例#9
0
        private void Executor_ProgressChanged(Object sender, ProgressChangedArgs e)
        {
            if (taskProgressBar.InvokeRequired) //This if else will check if you are on the same thread or not and go from there
            {
                MethodInvoker invoker = new MethodInvoker(
                    //Anonymous function/method
                    delegate()
                {
                    taskProgressBar.Value = e.Progress;
                });

                //taskProgressBar.Invoke(invoker);
                taskProgressBar.BeginInvoke(invoker);
            }
            else
            {
                taskProgressBar.Value = e.Progress;
            }
        }
示例#10
0
 private void Progressable_ProgressChanged(object sender, ProgressChangedArgs e)
 {
     if (Visible)
     {
         Invoke((MethodInvoker) delegate {
             if (progressBar_Progress.Value == e.Progress)
             {
                 return;
             }
             if (e.Progress < 100)
             {
                 progressBar_Progress.Value = e.Progress + 1;
             }
             progressBar_Progress.Value = e.Progress;
             if (e.Progress % 25 == 0)
             {
                 vmuBox.Image = Resources.load[m_random.Next(0, Resources.load.Count)];
             }
         });
     }
 }
示例#11
0
        void reader_ProgressChanged(object sender, ProgressChangedArgs e)
        {
            if (e.Progress >= 0 && e.Progress <= 100)
            {
                SetProgress(e.Progress);
            }

            if (!string.IsNullOrWhiteSpace(e.Msg))
            {
                AppendText(e.Msg);
            }
        }
示例#12
0
 private static void Converter_ProgressChanged(object sender, ProgressChangedArgs e)
 {
     Console.WriteLine("Progress changed {0}", e.Description);
 }
 private void InitializeTaskFatory_ProgressChanged(object sender, ProgressChangedArgs e)
 {
     CurrentProgress = e.Progress;
 }
示例#14
0
 protected virtual void OnDownloadProgressChanged(ProgressChangedArgs progressChangedArgs)
 {
     this.DownloadProgressChanged?.Invoke(this, progressChangedArgs);
 }
示例#15
0
 private void PortScanner_ProgressChanged(object sender, ProgressChangedArgs e)
 {
     PortsScanned = e.Value;
 }
示例#16
0
 protected virtual void OnUpgradeProgressChanged(ProgressChangedArgs progressChangedArgs)
 {
     this.UpgradeProgressChanged?.Invoke(this, progressChangedArgs);
 }
示例#17
0
 private void IpScanner_ProgressChanged(object sender, ProgressChangedArgs e)
 {
     IPAddressesScanned = e.Value;
 }
示例#18
0
 private void ProgressChanged(object sender, ProgressChangedArgs e)
 {
     Text = $"Registry Editor | Collecting Data from {e.Hive}";
     Console.WriteLine(e.Message);
 }
 private static void ConverterOnProgressChanged(object sender, ProgressChangedArgs progressChangedArgs)
 {
     OnProgressChangedEvent?.Invoke(progressChangedArgs.Description);
 }
示例#20
0
 protected virtual void OnProgressChanged(object sender, ProgressChangedArgs e) => ProgressChanged?.Invoke(sender, e);