private void SplashForm_Load(object sender, EventArgs e) { Cursor.Current = Cursors.WaitCursor; Application.DoEvents(); lblApplicationTitle.Text = AssemblyTitle; lblVersion.Text = string.Format("Version {0}", AssemblyVersion); tmrMain.Enabled = true; Status = "Please wait ..."; _currentLabelToAnimateIndex = 0; _currentText = string.Empty; _labelsToAnimate.Add(lblApplicationTitle); _labelsToAnimate.Add(lblVersion); foreach (Label l in _labelsToAnimate) { _originalLabelTexts.Add(l.Text); l.Text = string.Empty; } _updateFormText = new UpdateFormText(UpdateFormTextHandler); _timerTextAnimator = new System.Timers.Timer(TIMER_TEXT_ANIMATOR_INTERVAL); _timerTextAnimator.AutoReset = false; //Only fires the tick event once. The timer needs to then be restarted in the tick event handler. _timerTextAnimator.Elapsed += new System.Timers.ElapsedEventHandler(_timerTextAnimator_Elapsed); _timerTextAnimator.Start(); }
private void StartStatusAnimation() { _currentStatus = string.Empty; _updateStatus = new UpdateFormText(UpdateStatusHandler); _timerStatusAnimator = new System.Timers.Timer(STATUS_ANIMATOR_INTERVAL); _timerStatusAnimator.AutoReset = false; _timerStatusAnimator.Elapsed += new System.Timers.ElapsedEventHandler(_timerStatusAnimator_Elapsed); _timerStatusAnimator.Start(); }
/// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } _updateFormText = null; Cursor.Current = Cursors.Default; base.Dispose(disposing); }
/// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { _disposing = disposing; if (disposing && (components != null)) { components.Dispose(); } _updateFormTitle = null; _updateStatus = null; base.Dispose(disposing); }
public void AnimateFormTitle() { _currentFormTitle = string.Empty; _originalFormTitle = FormTitle; FormTitle = string.Empty; _updateFormTitle = new UpdateFormText(UpdateTitleHandler); _timerTitleAnimator = new System.Timers.Timer(TITLE_ANIMATOR_INTERVAL); _timerTitleAnimator.AutoReset = false; //Only fires the tick event once. The timer needs to then be restarted in the tick event handler. _timerTitleAnimator.Elapsed += new System.Timers.ElapsedEventHandler(_timerTextAnimator_Elapsed); _timerTitleAnimator.Start(); }
/// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { _disposing = disposing; if (disposing && (components != null)) { components.Dispose(); } _updateFormTitle = null; _updateStatus = null; if (_timerTitleAnimator != null) { _timerTitleAnimator.Stop(); } if (_timerStatusAnimator != null) { _timerStatusAnimator.Stop(); } base.Dispose(disposing); _disposed = true; }