Example #1
0
 public void EndProgress(object sender, Framework.EventArguments.ProgressEventArgs e)
 {
     _progressStack.RemoveAt(_progressStack.Count - 1);
     if (_progressStack.Count > 0)
     {
         ProgressInfo pi = _progressStack[_progressStack.Count - 1];
         UpdateProgressInfo(pi);
     }
 }
Example #2
0
 void p_UpdateProgress(object sender, Framework.EventArguments.ProgressEventArgs e)
 {
     _context.Send(new SendOrPostCallback(delegate(object state)
     {
         if (_frmDlg != null)
         {
             _frmDlg.UpdateProgress(sender, e);
         }
     }), null);
 }
Example #3
0
        public virtual bool OnUpdateProgress(string actionTitle, string actionText, int max, int position)
        {
            bool result = true;

            if (UpdateProgress != null)
            {
                Framework.EventArguments.ProgressEventArgs e = new Framework.EventArguments.ProgressEventArgs(this, actionTitle, actionText, max, position);
                UpdateProgress(this, e);
                result = !e.Cancel;
            }
            return(result);
        }
Example #4
0
 public void UpdateProgress(object sender, Framework.EventArguments.ProgressEventArgs e)
 {
     if (_progressStack.Count > 0)
     {
         ProgressInfo pi = _progressStack[_progressStack.Count - 1];
         pi.ActionText  = Utils.LanguageSupport.Instance.GetTranslation(e.ActionText);
         pi.ActionTitle = Utils.LanguageSupport.Instance.GetTranslation(e.ActionTitle);
         pi.Max         = e.Max;
         pi.Pos         = e.Position;
         e.Cancel       = _cancelled;
         UpdateProgressInfo(pi);
     }
 }
Example #5
0
        public void StartProgress(object sender, Framework.EventArguments.ProgressEventArgs e)
        {
            _cancelled           = false;
            buttonCancel.Text    = Utils.LanguageSupport.Instance.GetTranslation("Cancel");
            buttonCancel.Visible = e.CanCancel;
            buttonCancel.Enabled = true;
            ProgressInfo pi = new ProgressInfo();

            pi.ActionText  = Utils.LanguageSupport.Instance.GetTranslation(e.ActionText);
            pi.ActionTitle = Utils.LanguageSupport.Instance.GetTranslation(e.ActionTitle);
            pi.Max         = e.Max;
            pi.Pos         = e.Position;
            _progressStack.Add(pi);
            UpdateProgressInfo(pi);
        }
Example #6
0
 void p_EndProgress(object sender, Framework.EventArguments.ProgressEventArgs e)
 {
     _context.Send(new SendOrPostCallback(delegate(object state)
     {
         if (_frmDlg != null)
         {
             _frmDlg.EndProgress(sender, e);
             if (_frmDlg._progressStack.Count == 0)
             {
                 _frmDlg.Dispose();
                 _frmDlg = null;
             }
         }
     }), null);
 }
Example #7
0
 void p_StartProgress(object sender, Framework.EventArguments.ProgressEventArgs e)
 {
     _context.Send(new SendOrPostCallback(delegate(object state)
     {
         if (_frmDlg == null)
         {
             _frmDlg       = new FormProgress();
             _frmDlg.Owner = _owner;
             _frmDlg.StartProgress(sender, e);
             _frmDlg.Show();
         }
         else
         {
             _frmDlg.StartProgress(sender, e);
         }
     }), null);
 }
Example #8
0
 public virtual bool OnUpdateProgress(string actionTitle, string actionText, int max, int position)
 {
     bool result = true;
     if (UpdateProgress != null)
     {
         Framework.EventArguments.ProgressEventArgs e = new Framework.EventArguments.ProgressEventArgs(this, actionTitle, actionText, max, position);
         UpdateProgress(this, e);
         result = !e.Cancel;
     }
     return result;
 }