private void Light_Click(object sender, EventArgs e) { light = !light; if (light) { Light.ForeColor = Color.DodgerBlue; if (PulseTimer.Enabled) { PulseTimer.Stop(); } if (usb.colortimer.Enabled) { usb.colortimer.Stop(); } if (usb.colorchanger.Enabled) { usb.colorchanger.Stop(); } pulse = false; Pulse.ForeColor = Color.Gray; } else { Light.ForeColor = Color.Gray; } }
private void Pulse_Click(object sender, EventArgs e) { pulse = !pulse; if (pulse) { Pulse.ForeColor = Color.DodgerBlue; if (this.ModeBox.SelectedIndex == 0) { PulseTimer.Interval = 1; } if (this.ModeBox.SelectedIndex == 1) { PulseTimer.Interval = 1; } PulseTimer.Start(); light = false; Light.ForeColor = Color.Gray; } else { Pulse.ForeColor = Color.Gray; if (usb.colortimer.Enabled) { usb.colortimer.Stop(); } if (usb.colorchanger.Enabled) { usb.colorchanger.Stop(); } if (PulseTimer.Enabled) { PulseTimer.Stop(); } } }
private void CounterIncremented(object sender, PropertyChangedEventArgs e) { if (e.PropertyName == "CurrentCount") { // Reset timer PulseTimer.Dispose(); SetPulseTimer(); } }
public override void Initialize() { API.KeypressDelay = 333; API.PrintLine(" ------------------------------------------------------------"); API.PrintLine(" ------------ Welcome to HMonk v1.0.0 by Hivro --------------"); API.PrintLine(" ----- Please let me know if you have any suggestions -------"); API.PrintLine(" --- and I will work on them as best as I can, thank you! ---"); API.PrintLine(" ------------------------------------------------------------"); API.PrintLine(" ------------ WW = 30% --- BrM = 20% --- MW = N/A -----------"); PulseTimer.Start(); }
private void Pulsed(bool success) { Action action = () => Utilities.Radar.RefreshScreen(this, tp); if (success) { BeginInvoke(action); } action = () => PulseTimer.Start(); BeginInvoke(action); }
/// <summary> /// Handles the tick even from <see cref="PulseTimer"/> /// </summary> /// <param name="sender"><see cref="PulseTimer"/></param> /// <param name="e">Arguments</param> private void PulseTick(object sender, EventArgs e) { if (!ObjectManager.Initialized) { return; } PulseTimer.Stop(); var pulse = new Thread(ObjectManager.Pulse); pulse.Start(); }
public static Boolean Wait(object currentObj, int timeout) { PulseTimer pulseTimer = new PulseTimer(); TimerCallback timerDelegate = new TimerCallback(pulseTimer.timedPulse); // setup a timer to call the TimerCallback object System.Threading.Timer waitPulseTimer = new System.Threading.Timer (timerDelegate, currentObj, timeout, System.Threading.Timeout.Infinite); return(Wait(currentObj)); }
private void EnableUnreadCount_CheckedChanged(object sender, EventArgs e) { if (EnableUnreadCount.Checked) { pulse = true; Pulse.ForeColor = Color.DodgerBlue; Pulse.Enabled = false; light = false; Light.ForeColor = Color.Gray; Light.Enabled = false; if (PulseTimer.Enabled) { PulseTimer.Stop(); } if (!MailTimer.Enabled) { MailTimer.Start(); } } else { pulse = false; Pulse.ForeColor = Color.Gray; Pulse.Enabled = true; light = false; Light.ForeColor = Color.Gray; Light.Enabled = true; if (usb.colortimer.Enabled) { usb.colortimer.Stop(); } if (usb.colorchanger.Enabled) { usb.colorchanger.Stop(); } if (PulseTimer.Enabled) { PulseTimer.Stop(); } if (MailTimer.Enabled) { MailTimer.Stop(); } } }
public void Dispose() => PulseTimer.Dispose();