コード例 #1
0
 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;
     }
 }
コード例 #2
0
 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();
         }
     }
 }
コード例 #3
0
 private void CounterIncremented(object sender, PropertyChangedEventArgs e)
 {
     if (e.PropertyName == "CurrentCount")
     {
         // Reset timer
         PulseTimer.Dispose();
         SetPulseTimer();
     }
 }
コード例 #4
0
ファイル: rotation.cs プロジェクト: Showerss/Monk
 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();
 }
コード例 #5
0
        private void Pulsed(bool success)
        {
            Action action = () => Utilities.Radar.RefreshScreen(this, tp);

            if (success)
            {
                BeginInvoke(action);
            }

            action = () => PulseTimer.Start();
            BeginInvoke(action);
        }
コード例 #6
0
        /// <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();
        }
コード例 #7
0
ファイル: MonitorEx.cs プロジェクト: Blady-Com/gnatvm-src
        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));
        }
コード例 #8
0
 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();
         }
     }
 }
コード例 #9
0
 public void Dispose() => PulseTimer.Dispose();