Esempio n. 1
0
 /// <summary>
 /// Handles the Tick event of the _progressIndicatorTimer
 /// Displays a large progressindicator
 /// </summary>
 /// <param name="sender">The timer that triggered the event.</param>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 private void TimerShowBusyIndicator(object sender, EventArgs e)
 {
     lock (_syncRoot)
     {
         var timer = sender as Timer;
         if (timer != null)
         {
             timer.Stop();
         }
         SplashPanel.Show((AnimationControl).Owner.FindForm(), StatusControl.Text);
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Hides the temporary wait indicator.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 private void HideTemporaryWaitIndicator(object sender, EventArgs e)
 {
     lock (_syncRoot)
     {
         var timer = sender as Timer;
         if (timer != null)
         {
             timer.Stop();
         }
         SplashPanel.Close();
         SetStatusToDefault();
         AnimationVisible = false;
     }
 }
Esempio n. 3
0
        /// <summary>
        /// Updates the status strip.
        /// </summary>
        /// <param name="message">The message.</param>
        /// <param name="showProgressIndicator">if set to <c>true</c> [show progress indicator].</param>
        /// <param name="showLargeProgressIndicator">if set to <c>true</c> [show large progress indicator].</param>
        /// <param name="durationMilliseconds"></param>
        public void UpdateStatusStrip(string message, bool showProgressIndicator, bool showLargeProgressIndicator, int durationMilliseconds)
        {
            //if (this..InvokeRequired)
            //{
            //  ParentForm.Invoke(new StatusStripDelegate(UpdateStatusStrip), message, showProgressIndicator, showLargeProgressIndicator);
            //}
            lock (_syncRoot)
            {
                if (_progressIndicatorTimer != null)
                {
                    _progressIndicatorTimer.Stop();
                }
                SplashPanel.Close();

                if (showProgressIndicator)
                {
                    SetStatusTextStaticPrivate(message);

                    if (showLargeProgressIndicator)
                    {
                        //If still waiting after 2 seconds, show a larger progressindicator
                        _progressIndicatorTimer = new Timer {
                            Interval = 2000
                        };
                        _progressIndicatorTimer.Tick += TimerShowBusyIndicator;
                        _progressIndicatorTimer.Start();
                    }
                }
                else
                {
                    if (string.IsNullOrEmpty(message))
                    {
                        SetStatusToDefaultPrivate();
                    }
                    else
                    {
                        SetStatusTextPrivate(message, durationMilliseconds);
                    }
                }
                AnimationVisible = showProgressIndicator;
            }
        }