/// <summary> /// Method for call the delagetes /// </summary> /// <param name="e"></param> protected virtual void OnButtonRepeatState(LBButtonEventArgs e) { if (this.ButtonRepeatState != null) { this.ButtonRepeatState(this, e); } }
/// <summary> /// Timer event /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Timer_Tick(object sender, EventArgs e) { this.tmrRepeat.Enabled = false; // Update the interval if (tmrRepeat.Interval == this.startRepeatInterval) { this.tmrRepeat.Interval = this.repeatInterval; } // Call the delagate LBButtonEventArgs ev = new LBButtonEventArgs(); ev.State = this.State; this.OnButtonRepeatState(ev); this.tmrRepeat.Enabled = true; }
/// <summary> /// Mouse up event /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void OnMuoseUp(object sender, MouseEventArgs e) { // Change the state if (this.State == ButtonState.Normal) { this.State = ButtonState.Pressed; } else { this.State = ButtonState.Normal; } this.Invalidate(); // Call the delagates LBButtonEventArgs ev = new LBButtonEventArgs(); ev.State = this.State; this.OnButtonChangeState(ev); // Disable the timer this.tmrRepeat.Enabled = false; }
/// <summary> /// Mouse down event /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void OnMouseDown(object sender, MouseEventArgs e) { // Change the state if (bAutoRebound) { this.State = ButtonState.Pressed; this.Invalidate(); } // Call the delagates LBButtonEventArgs ev = new LBButtonEventArgs(); ev.State = this.State; this.OnButtonChangeState(ev); // Enable the repeat timer if (this.RepeatState != false) { this.tmrRepeat.Interval = this.StartRepeatInterval; this.tmrRepeat.Enabled = true; } }
/// <summary> /// Timer event /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Timer_Tick(object sender, EventArgs e) { this.tmrRepeat.Enabled = false; // Update the interval if (tmrRepeat.Interval == this.startRepeatInterval) this.tmrRepeat.Interval = this.repeatInterval; // Call the delagate LBButtonEventArgs ev = new LBButtonEventArgs(); ev.State = this.State; this.OnButtonRepeatState(ev); this.tmrRepeat.Enabled = true; }
/// <summary> /// Method for call the delagetes /// </summary> /// <param name="e"></param> protected virtual void OnButtonRepeatState(LBButtonEventArgs e) { if (this.ButtonRepeatState != null) this.ButtonRepeatState(this, e); }