protected void OnIndividualProgressUpdate(object sender, ProgressChangedEventArgs e)
 {
     Application.Invoke (delegate {
         if (model.Active) {
             IndividualProgressBar.Fraction = e.ProgressPercentage / (double)100;
         }
     });
 }
		/// <summary>
		/// Occurs in case of progress change.
		/// </summary>
		/// <param name="e">ProgressChangedEventArgs.</param>
		protected virtual void OnProgressChanged(ProgressChangedEventArgs e)
		{
			ProgressChangedDelegate handler = ProgressChanged;

			if (handler != null)
			{
				handler(this, e);
			}
		}
示例#3
0
		private void ProgressChanged(object sender, ProgressChangedEventArgs e)
		{
			if (e.Progress == -1d)
			{
				log.InfoFormat("\r\n\r\n{0}", e.Status);
			}
			else
			{
				log.InfoFormat("{0}% / {1}", e.Progress, e.Status);
			}
		}
示例#4
0
 private void task_ProgressChanged(object sender, ProgressChangedEventArgs e)
 {
     if (IsDisposed || !IsHandleCreated)
     return;
        if (InvokeRequired)
        {
     if (DateTime.Now - lastUpdate < new TimeSpan(0, 0, 0, 0, 300))
      return;
     lastUpdate = DateTime.Now;
     Invoke((EventHandler<ProgressChangedEventArgs>)task_ProgressChanged, sender, e);
     return;
        }
        ErasureTarget target = sender as ErasureTarget;
        if (target == null)
     return;
        SteppedProgressManager progress = target.Progress as SteppedProgressManager;
        if (progress == null)
     return;
        UpdateProgress(progress, e);
 }
示例#5
0
 /// <summary>
 /// Raises the <see cref="E:ProgressChanged"/> event.
 /// </summary>
 /// <param name="e">The <see cref="MLifterAudioBookGenerator.ProgressChangedEventArgs"/> instance containing the event data.</param>
 /// <remarks>Documented by Dev02, 2008-05-20</remarks>
 public static void OnProgressChanged(ProgressChangedEventArgs e)
 {
     ProgressChangedEventHandler handler = ProgressChanged;
     if (handler != null)
     {
         foreach (ProgressChangedEventHandler caster in handler.GetInvocationList())
         {
             ISynchronizeInvoke SyncInvoke = caster.Target as ISynchronizeInvoke;
             try
             {
                 if (SyncInvoke != null && SyncInvoke.InvokeRequired)
                     SyncInvoke.Invoke(handler, new object[] { null, e });
                 else
                     caster(null, e);
             }
             catch
             { }
         }
     }
 }
示例#6
0
 void searcher_ProgressChanged(object sender, ProgressChangedEventArgs e)
 {
     ThreadSafeSetText(lbCurrentOperation, Convert.ToString(e.UserState));
     ThreadSafeChangeProgressBarValue(progressBar1, e.ProgressPercentage);
 }
 /// <summary>
 /// Checks if worker progress is changed
 /// </summary>
 private void WorkerOnProgressChanged(object sender, ProgressChangedEventArgs e)
 {
     CurrentProgress = e.ProgressPercentage;
 }
 private void Thread_ProgressChanged(object sender, ProgressChangedEventArgs e)
 {
     throw new NotImplementedException();
 }
示例#9
0
 private void asyncEventWorker_ProgressChanged(object sender, ProgressChangedEventArgs args)
 {
 }
示例#10
0
        public void ReportProgress(long total, long completed, object userState)
        {
            if (_reportProgress == false)
                throw new InvalidOperationException("WorkerReportsProgress is set to false.");

            ProgressChangedEventArgs progressChangedEventArgs = new ProgressChangedEventArgs(
                total, completed, userState);

            ThreadPool.QueueUserWorkItem(new WaitCallback(this.OnProgressChanged),
                progressChangedEventArgs);
        }
示例#11
0
        private void HttpResponseReceived(object sender, ProgressChangedEventArgs e)
        {
            try
            {
                string guid = sender as string;
                TasklistItem tasklistItem = this.DownloadList.GetTaskListItem(guid);

                if (tasklistItem != null)
                {
                    tasklistItem.State = TasklistItem.ItemState.Incomplete;
                    if (tasklistItem.Total < e.Total)
                        tasklistItem.Total = e.Total;

                    this.DownloadList.Invalidate();
                }

                ChannelItem channelItem = _channelManager.Channel.GetItem(guid);
                if (channelItem != null && channelItem.Enclosure.Length < e.Total)
                {
                    channelItem.Enclosure.Length = e.Total;
                    _channelManager.Channel.Save();
                }
            }
            catch (Exception ex)
            {
                OdeoApplication.TraceException("FrmChannel::HttpResponseReceived", ex);
            }
        }
示例#12
0
 void ProgressChanged(object sender, ProgressChangedEventArgs e)
 {
     ByDenisRafi.Value = e.ProgressPercentage;
 }
        void bgwTask_ProgressChanged(object sender, ProgressChangedEventArgs e)
        {
            switch (e.ProgressPercentage)
            {
            case EV_UPDATE_PARAMETER:
                if (labelWorkOrder.Text.Length == WORKORDER_DIGIT)
                {
                    labelGood.Text           = ctrlSys.PartInGoodBox.ToString();
                    labelQuantityWorked.Text = ctrlSys.QuantityWorked.ToString();
                    labelReject1.Text        = ctrlSys.PartInRejectBox[0].ToString();
                    labelReject2.Text        = ctrlSys.PartInRejectBox[1].ToString();
                    labelReject3.Text        = ctrlSys.PartInRejectBox[2].ToString();
                    labelReject4.Text        = ctrlSys.PartInRejectBox[3].ToString();
                    labelBoxFinish.Visible   = ctrlSys.BoxFinished;
                    labelPartEmpty.Visible   = ctrlSys.PartEmpty;
                }
                break;

            case EV_START_TAG_METER:
                bgwTagMeter.RunWorkerAsync();
                break;

            case EV_STOP_TAG_METER:
                bgwTagMeter.CancelAsync();
                break;

            case EV_START_TAG_PROGRAMMER:
                bgwTagProgrammer.RunWorkerAsync();
                break;

            case EV_START_REGISTER_GOOD:
                bgwRegister.RunWorkerAsync(true);
                break;

            case EV_START_REGISTER_BAD:
                bgwRegister.RunWorkerAsync(false);
                break;

            case EV_BOX_FINISH:
                bgwBoxFinish.RunWorkerAsync();
                break;

            case EV_MESSAGE:
                switch (ctrlSys.MessageType)
                {
                case MESSAGE_TYPE_INFORMATION:
                    MessageBox.Show(ctrlSys.Message, "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    break;

                case MESSAGE_TYPE_WARNING:
                    MessageBox.Show(ctrlSys.Message, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    break;

                case MESSAGE_TYPE_ERROR:
                    MessageBox.Show(ctrlSys.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    break;
                }
                break;

            case EV_START:
                btnStart.Enabled           = false;
                btnReset.Enabled           = false;
                btnStop.Enabled            = true;
                btnPause.Enabled           = true;
                labelRun.Visible           = true;
                btnLogout.Enabled          = false;
                btnReadUID.Enabled         = false;
                btnWorkOrder.Enabled       = false;
                btnRePrint.Enabled         = false;
                btnClosePartialBox.Enabled = false;
                btnQA_ReWork.Enabled       = false;
                labelRun.Text = "RUNNING";
                break;

            case EV_STOP:
                if (bgwTagMeter.IsBusy)
                {
                    bgwTagMeter.CancelAsync();
                }
                if (bgwTagProgrammer.IsBusy)
                {
                    bgwTagProgrammer.CancelAsync();
                }

                bgwTagMeter.CancelAsync();
                bgwTagProgrammer.CancelAsync();
                btnStop.Enabled  = false;
                btnPause.Enabled = false;
                labelRun.Visible = false;
                btnStart.Enabled = bInitSuccess && !ctrlSys.Alarm && (!chkTest.Checked || bInitialTagMeter);
                //btnStart.Enabled = bInitSuccess && !ctrlSys.Alarm && bInitialTagMeter;
                btnLogout.Enabled          = true;
                btnReset.Enabled           = true;
                btnReadUID.Enabled         = true;
                btnStop.BackColor          = this.BackColor;
                btnWorkOrder.Enabled       = true;
                btnRePrint.Enabled         = true;
                btnClosePartialBox.Enabled = true;
                btnQA_ReWork.Enabled       = true;

                if (labelWorkOrder.Text.Length == WORKORDER_DIGIT)
                {
                    //labelGood.Text = proParam.iTotalGoodInDatabase.ToString();
                    labelGood.Text           = ctrlSys.PartInGoodBox.ToString();
                    labelQuantityWorked.Text = ctrlSys.QuantityWorked.ToString();
                }

                btnLogout.Enabled = true;

                switch (ctrlSys.Status)
                {
                case SYSTEM_NO_POWER:
                    labelMessage.Text      = "No 24 VDC !";
                    labelMessage.BackColor = Color.Red;
                    labelMessage.ForeColor = Color.White;
                    labelMessage.Visible   = true;
                    break;

                case SYSTEM_ESTOP:
                    labelMessage.Text      = "Emergency STOP !";
                    labelMessage.BackColor = Color.Red;
                    labelMessage.ForeColor = Color.White;
                    labelMessage.Visible   = true;
                    break;

                case SYSTEM_NO_PNEUMATIC_AIR:
                    labelMessage.Text      = "No Pneumatic Air !";
                    labelMessage.BackColor = Color.Red;
                    labelMessage.ForeColor = Color.White;
                    labelMessage.Visible   = true;
                    break;

                case SYSTEM_LINEAR_ACTUATOR_ALARM:
                    labelMessage.Text      = "Linear Actuator Alarm !";
                    labelMessage.BackColor = Color.Red;
                    labelMessage.ForeColor = Color.White;
                    labelMessage.Visible   = true;
                    break;

                case SYSTEM_STOP:
                    labelMessage.Visible = false;
                    labelMessage.Text    = String.Empty;
                    break;
                }
                break;
            }
        }
示例#14
0
 private static void imgProcessRoutine_ProgressChanged(object sender, ProgressChangedEventArgs e)
 {
     MainWindow.mMainWindow.TB_yolo_info.Text = processTimeStr;
 }
示例#15
0
        private void backgroundFetch_ProgressChanged(object sender, ProgressChangedEventArgs e)
        {
            Tuple <List <Draw>, IDictionary <string, string>, string> agruments =
                (Tuple <List <Draw>, IDictionary <string, string>, string>)e.UserState;
            List <Draw> itemValue = agruments.Item1;
            IDictionary <string, string> realvals = agruments.Item2;
            string   ptname = agruments.Item3;
            DateTime facttime;

            if (realvals.ContainsKey("Quality") && realvals.ContainsKey("FactTime") &&
                DateTime.TryParse(realvals["FactTime"], out facttime))
            {
                if (DateTime.Now - facttime >
                    TimeSpan.FromSeconds(Properties.Settings.Default.DisplayTimeout))
                {
                    realvals["Quality"] = "TIMEOUT";
                }
            }
            if (!mustReload)
            {
                DateTime ver, basever;
                if (realvals.ContainsKey("Version") && realvals.ContainsKey("BaseVersion") &&
                    DateTime.TryParse(realvals["Version"], out ver) &&
                    DateTime.TryParse(realvals["BaseVersion"], out basever))
                {
                    mustReload = ver > basever;
                    if (mustReload)
                    {
                        reloadPtName = ptname;
                    }
                }
                else
                {
                    mustReload = false;
                }
            }
            // заполнение данными приемников данных
            string[] fetchdata = new string[]
            { "PVText", "PV", "PVPercent",
              "SPText", "SP", "SPPercent",
              "OPText", "OP", "OPPercent",
              "HVText", "DVText", "KonturMode",
              "BackColor", "ForeColor", "QuitAlarms",
              "HasAlarms", "HasLostAlarms", "Blink", "Quality",
              "UserLevel",
              "DAY", "LASTDAY", "MONTH", "LASTMONTH" };
            foreach (Draw drw in itemValue)
            {
                foreach (string propname in fetchdata)
                {
                    if (drw.Props.ContainsKey(propname) && realvals.ContainsKey(propname) ||
                        propname.Equals("Blink") && drw.Props.ContainsKey("Blink"))
                    {
                        string propType = drw.Props[propname].GetType().Name;
                        int    intvar;
                        switch (propType)
                        {
                        case "Boolean":
                            if (propname.Equals("Blink"))
                            {
                                drw.Props[propname] = blink;
                            }
                            else
                            {
                                bool boolvar;
                                if (bool.TryParse(realvals[propname], out boolvar))
                                {
                                    drw.Props[propname] = boolvar;
                                }
                            }
                            break;

                        case "Single":
                            drw.Props[propname] =
                                (float)Data.FloatParse(realvals[propname]); break;

                        case "Color":
                            if (propname.Equals("BackColor") || propname.Equals("ForeColor"))
                            {
                                if (int.TryParse(realvals[propname], out intvar))
                                {
                                    drw.Props[propname] = Color.FromArgb(intvar);
                                }
                            }
                            break;

                        case "Int32":
                            if (propname.Equals("UserLevel"))
                            {
                                drw.Props[propname] = (updater != null) ?
                                                      UserInfo.UserLevelToInt(updater.UserLevel()) : 0;
                            }
                            else
                            if (int.TryParse(realvals[propname], out intvar))
                            {
                                drw.Props[propname] = intvar;
                            }
                            break;

                        default:
                            drw.Props[propname] = realvals[propname];
                            break;
                        }
                    }
                }
                refreshDraw(drw);
            }
        }
示例#16
0
 private void BackgroundWorker_ProgressChanged(object sender, ProgressChangedEventArgs e)
 {
     UpdateProgressBar.Value = e.ProgressPercentage;
 }
示例#17
0
 private void backgroundWorker1_ProgressChanged(object sender, ProgressChangedEventArgs e)
 {
     progressBar1.Value = e.ProgressPercentage;
 }
示例#18
0
 private void Worker_ProgressChanged(object sender, ProgressChangedEventArgs e)
 {
     Prg.Value = e.ProgressPercentage;
 }
示例#19
0
 private void OnWorkerServiceProgressChanged(object sender, ProgressChangedEventArgs e)
 {
     SwitchTrayIcon(e.WorkerProgress);
 }
 void bgwTagProgrammer_ProgressChanged(object sender, ProgressChangedEventArgs e)
 {
 }
示例#21
0
        /// <summary>
        /// Handles the Load event of the MainForm control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        /// <remarks>Documented by Dev02, 2008-03-10</remarks>
        private void MainForm_Load(object sender, EventArgs e)
        {
            //load codecs
            codecs.XMLString = Settings.Default.CodecSettings;

            //load recent LearningModule from settings
            if (!string.IsNullOrEmpty(Settings.Default.RecentLearningModule) && File.Exists(Settings.Default.RecentLearningModule))
                textBoxLearningModule.Text = Settings.Default.RecentLearningModule;

            //load recent AudioBook Path from settings
            if (!string.IsNullOrEmpty(Settings.Default.RecentAudioBook))
            {
                FileInfo recentaudiobook = new FileInfo(Settings.Default.RecentAudioBook);

                textBoxAudiobook.Text = recentaudiobook.FullName;
            }

            GenerateAvailableFields();

            //use the events to reset to "default" state
            BusinessLayer_WorkingThreadFinished(null, EventArgs.Empty);
            ProgressChangedEventArgs args = new ProgressChangedEventArgs();
            args.enableProgressReporting = false;
            BusinessLayer_ProgressChanged(null, args);

            //the following line is required for the login form to work
            MLifter.BusinessLayer.LearningModulesIndex learningModules = new MLifter.BusinessLayer.LearningModulesIndex(
                Path.Combine(Application.StartupPath, Settings.Default.ConfigPath),
                Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), Settings.Default.ConfigurationFolder),
                (MLifter.DAL.GetLoginInformation)MLifter.Controls.LoginForm.OpenLoginForm,
                (MLifter.DAL.DataAccessErrorDelegate)delegate { return; }, String.Empty);
        }
示例#22
0
 void backgroundWorker1_ProgressChanged(object sender, ProgressChangedEventArgs e)
 {
     this.label1.Text = e.ProgressPercentage + "%";
 }
 /// <summary>
 /// Control table Progress Changed
 /// </summary>
 /// <param name="sender">system sender</param>
 /// <param name="e">system ProgressChangedEventArgs</param>
 private void MonitorComPortProgress(object sender, ProgressChangedEventArgs e)
 {
     try
     {
         string message;
         message = e.UserState as string;
         if (this.OnUpdateEnd != null)
         {
             // if OnQueryEnd was implement
             this.OnUpdateEnd(this, null, message);
         }
     }
     catch (Exception exception)
     {
         exception.ToString();
     }
 }
        private void AddTracks_ProgressChanged(object sender, ProgressChangedEventArgs e)
        {
            Track track = (Track)e.UserState;

            currentPlaylist.addTrack(track);
        }
 protected virtual void OnProgressChanged(ProgressChangedEventArgs e);
        private void bgwWorker_ProgressChanged(object sender, ProgressChangedEventArgs e)
        {
            int Percentage;

            // Use the progress in percentage to differ the different steps.
            // It looks a little bit stange. The real progress is stored in an member of this class.
            // Try to save the step in an member, lead to glitches. I used the ProgressPercentage as work around
            bool ForceReport = false;

            if (e.UserState != null && e.UserState.GetType().Equals(typeof(bool)))
            {
                ForceReport = (bool)e.UserState;
            }

            // Report Progress by time Interval or if report is forced
            if (ForceReport || _fileMover.CheckUpdateInterval())
            {
                _fileMover.TimeLastReport = DateTime.Now;

                FileMover.ProcessStep ProcessStep = (FileMover.ProcessStep)e.ProgressPercentage;
                switch (ProcessStep)
                {
                case FileMover.ProcessStep.Count_Start:
                    ProgressBarInv.Style(this.pbaProgress, ProgressBarStyle.Marquee);
                    TextBoxInv.Text(this.txtProgressPercent, "");
                    TextBoxInv.Text(this.txtProgressValue, "");
                    TextBoxInv.Text(this.txtRemainTime, "");
                    break;

                case FileMover.ProcessStep.Count_Busy:
                    TextBoxInv.Text(this.txtProgressValue, this._fileMover.FileTotalCount.ToString(FORMAT_VALUE_NUMBER));
                    break;

                case FileMover.ProcessStep.Count_Finish:
                    ProgressBarInv.Style(this.pbaProgress, ProgressBarStyle.Blocks);
                    ProgressBarInv.Value(this.pbaProgress, 0);
                    break;

                case FileMover.ProcessStep.Move_Start:
                    ProgressBarInv.Style(this.pbaProgress, ProgressBarStyle.Blocks);
                    ProgressBarInv.Value(this.pbaProgress, 0);
                    TextBoxInv.Text(this.txtProgressPercent, "");
                    TextBoxInv.Text(this.txtProgressValue, string.Format(FORMAT_VALUE_MOVE, new object[] { 0.ToString(FORMAT_VALUE_NUMBER), _fileMover.FileTotalCount.ToString(FORMAT_VALUE_NUMBER) }));
                    TextBoxInv.Text(this.txtRemainTime, "");
                    break;

                case FileMover.ProcessStep.Move_Busy:
                    Percentage = Convert.ToInt32(Matehmatics.Percentages(this._fileMover.TotalFilesHandled, this._fileMover.FileTotalCount));
                    ProgressBarInv.Value(this.pbaProgress, Percentage);
                    TextBoxInv.Text(this.txtProgressPercent, string.Format(FORMAT_PERCENTAGE, Percentage));
                    TextBoxInv.Text(this.txtProgressValue, string.Format(FORMAT_VALUE_MOVE, new object[] { this._fileMover.TotalFilesHandled.ToString(FORMAT_VALUE_NUMBER), this._fileMover.FileTotalCount.ToString(FORMAT_VALUE_NUMBER) }));

                    TimeSpan RemainingTime = Matehmatics.RemainingTime((DateTime.Now - this._fileMover.TimeProcessStart), (double)this._fileMover.TotalFilesHandled, (double)this._fileMover.FileTotalCount, out _);
                    if (RemainingTime.Days > 0)
                    {
                        TextBoxInv.Text(this.txtRemainTime, RemainingTime.ToString(Settings.Default.Move_RemainTimeDays));
                    }
                    else
                    {
                        TextBoxInv.Text(this.txtRemainTime, RemainingTime.ToString(Settings.Default.Move_RemainTimeNoDays));
                    }
                    break;

                case FileMover.ProcessStep.Move_Finish:
                    Percentage = Convert.ToInt32(Matehmatics.Percentages(this._fileMover.FileMove, this._fileMover.FileTotalCount));
                    ProgressBarInv.Value(this.pbaProgress, Percentage);
                    TextBoxInv.Text(this.txtProgressPercent, string.Format(FORMAT_PERCENTAGE, Percentage));
                    TextBoxInv.Text(this.txtProgressValue, string.Format(FORMAT_VALUE_MOVE, new object[] { this._fileMover.FileMove.ToString(FORMAT_VALUE_NUMBER), this._fileMover.FileTotalCount.ToString(FORMAT_VALUE_NUMBER) }));
                    break;

                case FileMover.ProcessStep.Cancel:
                case FileMover.ProcessStep.Exception:
                    ProgressBarInv.Style(this.pbaProgress, ProgressBarStyle.Blocks);
                    TextBoxInv.Text(this.txtRemainTime, "");
                    break;

                default:
                    throw new ArgumentException("MainForm->worker_ProgressChanged->Invalid value", nameof(ProcessStep));
                }
            }
        }
 private void OnCollectionMatcherProgressChanged(ProgressChangedEventArgs eventArgs)
 {
     if (this.ProgressChanged != null)
     {
         this.ProgressChanged(this, eventArgs);
     }
 }
示例#28
0
 private void NotifyParentOfResponse(long total, long completed)
 {
     try
     {
         _progressEventArgs = new ProgressChangedEventArgs(total, completed, null);
         if (_parent != null)
             _parent.Invoke(new System.EventHandler(this.OnResponseReceived));
         else
             this.OnResponseReceived(this, _progressEventArgs);
     }
     catch (Exception)
     {
         if (_state != null)
             _state.Dispose();
     }
 }
示例#29
0
	private void DoReadGedcom_ProgressChanged(object sender, ProgressChangedEventArgs e)
	{
		GedcomRecordReader reader = (GedcomRecordReader)sender;

		Gtk.Application.Invoke(delegate
		                       {
			ProgressBar.Text = string.Format("{0} %", reader.Progress);
			ProgressBar.Fraction = (e.ProgressPercentage / 100.0);
		});
	}
示例#30
0
 public void ReportProgress(int percentProgress, object userState, object argument)
 {
     ProgressChangedEventArgs args = new ProgressChangedEventArgs(percentProgress, userState, argument);
     AsyncOperation asyncOp = this.userStateToLifetime[userState] as AsyncOperation;
     if (asyncOp == null) return;
     asyncOp.Post(this.SendOrPostReportProgress, args);
 }
示例#31
0
 // This event handler updates the progress.
 private void AssetLocalization_BackgroundWorker_ProgressChanged(object sender, ProgressChangedEventArgs e)
 {
     AssetLocalization_StatusText.Text = SDKFuncs.GetProgressString(currentType, e.ProgressPercentage);
     AssetLocalization_StatusBar.Value = e.ProgressPercentage;
 }
示例#32
0
 private void asyncEventWorker_ProgressChanged(object sender, ProgressChangedEventArgs args)
 {
     this.progressBar.Value = args.ProgressPercentage;
     this.SetStatusText(args.ProgressPercentage.ToString() + "%");
 }
示例#33
0
 private void NotifyParentOfProgress(long total, long completed, byte[] data)
 {
     try
     {
         _progressEventArgs = new ProgressChangedEventArgs(total, completed, data);
         if (_parent != null)
             _parent.Invoke(new System.EventHandler(this.OnDownloadProgress));
         else
             this.OnDownloadProgress(this, _progressEventArgs);
     }
     catch (Exception)
     {
         if (_state != null)
             _state.Dispose();
     }
 }
示例#34
0
 private void bgw_load_ProgressChanged(object sender, ProgressChangedEventArgs e)
 {
     FISCA.Presentation.MotherForm.SetStatusBarMessage("列印「日常生活表現預警表」" + e.UserState, e.ProgressPercentage);
 }
示例#35
0
 protected virtual void OnProgressChanged(ProgressChangedEventArgs e)
 {
     if (this.ProgressChanged != null)
         this.ProgressChanged(this, e);
 }
示例#36
0
 private void dupeFinderWorker_ProgressChanged(object sender, ProgressChangedEventArgs e)
 {
     modifiedProgressBarLoading1.Value = (int)(modifiedProgressBarLoading1.Maximum * (float)e.ProgressPercentage / 100f);
 }
示例#37
0
 private void DownloadLWJGLThread_ProgressChanged(object sender, ProgressChangedEventArgs e)
 {
     Debug.WriteLine("[DownloadLWJGLThread_ProgressChanged] " + e.UserState);
     this.DownloadLWJGLStatusForm.Activate();
     this.DownloadLWJGLStatusForm.Controls.Find("DownloadStatusLabel", true)[0].Text = "Downloading LWJGL...\n" + e.UserState;
 }
示例#38
0
 private void OnProgressChanged(object sender, ProgressChangedEventArgs e)
 {
     DispatcherHelper.CheckBeginInvokeOnUI(() => Progress = e);
 }
示例#39
0
 /// <summary>
 /// Reports the progress.
 /// </summary>
 /// <param name="index">The index.</param>
 /// <param name="count">The count.</param>
 /// <param name="worker">The worker.</param>
 /// <remarks>Documented by Dev02, 2008-03-31</remarks>
 public static void ReportProgress(int index, int count)
 {
     double percent = count == 0 ? -1 : 1.0 * index * 100 / count;
     ProgressChangedEventArgs args = new ProgressChangedEventArgs();
     args.percentProgress = percent;
     args.enableProgressReporting = percent >= 0;
     OnProgressChanged(args);
 }
示例#40
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Treatment2(object sender, ProgressChangedEventArgs e)
 {
     TimeTreatment.Value = e.ProgressPercentage;
 }
示例#41
0
 /// <summary>
 /// Handles the ProgressChanged event of the BusinessLayer control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="MLifterAudioBookGenerator.ProgressChangedEventArgs"/> instance containing the event data.</param>
 /// <remarks>Documented by Dev02, 2008-05-20</remarks>
 void BusinessLayer_ProgressChanged(object sender, ProgressChangedEventArgs e)
 {
     progressBar.Visible = e.enableProgressReporting;
     progressBar.Value = e.percentProgress > 0 ? Convert.ToInt32(e.percentProgress) : 0;
 }
示例#42
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void RefuelingToBus0(object sender, ProgressChangedEventArgs e)
 {
     TimeRefueling.Value += e.ProgressPercentage;
 }
示例#43
0
 protected virtual void OnProgressChanged(object progressChangedEventArgs)
 {
     _progressChangedEventArgs = progressChangedEventArgs as ProgressChangedEventArgs;
     _parent.Invoke(new System.EventHandler(this.NotifyParentProgress));
 }
 void worker_ProgressChanged(object sender, ProgressChangedEventArgs e)
 {
     pbStatus.Value = e.ProgressPercentage;
 }
		// Async(ThreadPool) called by ReportProgress for reporting progress
		private void ProgressHelper(object o){
			mProgressArgs = (ProgressChangedEventArgs)o;//TODO put this in a queue to preserve the userState if the client code call ReportProgress in quick succession
			mGuiMarshaller.Invoke(new System.EventHandler(TellThemOnGuiProgress));			
		}
示例#46
0
 private void bw_ProgressChanged(object sender,
                                 ProgressChangedEventArgs e)
 {
     this.tbProgress.Text = (e.ProgressPercentage.ToString() + "%");
 }
示例#47
0
 private void HttpDataReceived(object sender, ProgressChangedEventArgs e)
 {
     string guid = sender as string;
     if (guid != null)
     {
         try
         {
             TasklistItem listItem = this.DownloadList.GetTaskListItem(guid);
             listItem.Completed = e.Completed;
             listItem.Description = this.GetProgressDescription(listItem);
             this.DownloadList.Invalidate();
         }
         catch (Exception ex)
         {
             OdeoApplication.TraceException("FrmChannel::HttpDataReceived", ex);
         }
     }
 }
示例#48
0
 private void ProgressChanged(object sender, ProgressChangedEventArgs e)
 {
     // Run action required as test progresses (i.e. update GUI).
     Update(e.ProgressPercentage, e.UserState as string);
 }
示例#49
0
 void StartupWorker_ProgressChanged(object sender, ProgressChangedEventArgs e)
 {
     if (this.StartupForm != null)
         this.StartupForm.PercentComplete += (int) e.Completed;
 }
 private void WorkerProgressChanged(object sender, ProgressChangedEventArgs e)
 {
     InformationPanel.ChangeInformationPanelMessage(infoPanel, e.UserState.ToString());
 }
示例#51
0
 private void dumpLoader_LoadProgressChanged(object sender, ProgressChangedEventArgs e)
 {
     if (m_curTask != null)
         m_curTask.SetProgress(e.ProgressPercentage);
 }
示例#52
0
 private void bWDatabaseUpdate_ProgressChanged(object sender, ProgressChangedEventArgs e)
 {
     lblResultMessage.Text = e.UserState.ToString();
 }
        public LocalCollectionMatcherResult Match()
        {
            LocalCollectionMatcherResult result = new LocalCollectionMatcherResult();

            foreach (Release release in this.collectionManager.Releases)
            {
                result.DeletedReleases.Add(release);
            }

            this.collectionScanner.Scan();

            int totalAlbums = this.collectionScanner.LocalCollection.AlbumArtists.Values.Select(r => r.Albums.Count).Sum();
            int scannedAlbums = 0;

            LocalCollection collection = this.collectionScanner.LocalCollection;
            foreach (LocalAlbumArtist lAlbumArtist in collection.AlbumArtists.Values)
            {
                foreach (LocalAlbum lAlbum in lAlbumArtist.Albums.Values)
                {
                    Release release = this.collectionManager.Operations.GetReleaseByLocalAlbumName(lAlbum);

                    if (release == null)
                    {
                        result.NewReleases.Add(lAlbum);
                    }
                    else
                    {
                        result.DeletedReleases.Remove(release);

                        bool filesExist = release.Tracklist.All(t => {
                            string musicDirectory = this.collectionManager.Settings.MusicDirectory;
                            return File.Exists(Path.Combine(musicDirectory, t.RelativeFilename));
                        });

                        if (!filesExist && !this.collectionManager.Operations.MatchReleaseWithLocalAlbum(release, lAlbum))
                        {
                            result.ChangedReleases.Add(new Tuple<Release, LocalAlbum>(release, lAlbum));
                        }
                        else
                        {
                            result.UnchangedReleases.Add(release);
                        }
                    }

                    ++scannedAlbums;
                    ProgressChangedEventArgs eventArgs = new ProgressChangedEventArgs((double)scannedAlbums / totalAlbums);
                    this.OnCollectionMatcherProgressChanged(eventArgs);
                    if (eventArgs.Cancel)
                    {
                        return result;
                    }
                }
            }

            return result;
        }
示例#54
0
 private void backgroundWorkerAnalyze_ProgressChanged(object sender, ProgressChangedEventArgs e)
 {
     progressBarAnalyze.Invoke(new Action(() => progressBarAnalyze.Value = e.ProgressPercentage));
 }
示例#55
0
 private void ProgressChanged(object sender, ProgressChangedEventArgs e)
 {
 }
 /// <summary>
 ///  Occurs when System.ComponentModel.BackgroundWorker.ReportProgress(System.Int32) is called.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The <see cref="ProgressChangedEventArgs"/> instance containing the event data.</param>
 private void LoadUserSecurityBackgroundProgress(object sender, ProgressChangedEventArgs e)
 {
 }
示例#57
0
 private void eval_a(object A_0, ProgressChangedEventArgs A_1)
 {
     this.eval_h.eval_f(".");
 }
示例#58
0
 private void ChangeProgress(object sender, ProgressChangedEventArgs e)
 {
     progressBar1.Value = e.ProgressPercentage;
 }
 private void OnAutomaticSupportServiceDownloadProgressChanged(object sender, ProgressChangedEventArgs e)
 {
     Progress = e.Progress;
     RemainingTime = e.RemainingTime;
 }
示例#60
0
 protected void GlobalWorker_ProgressChanged(object sender, ProgressChangedEventArgs e)
 {
     Progress.Instance.UpdateProgressValue();
 }