private void button1_Click(object sender, EventArgs e)
 {
     //if already monitoring, stop monitoring
     if (isMonitoring)
     {
         HudsonMonitor.isMonitoringEnabled = false;
         isMonitoring   = false;
         bStartMon.Text = "Start Monitoring";
         //disable the disable button
         bDiasble.Enabled = false;
     }
     //if not monitoring, start monitoring
     else
     {
         HudsonMonitor.isMonitoringEnabled = true;
         //start the monitor
         workerThread = new Thread(HudsonMonitor.run);
         workerThread.Start();
         isMonitoring = true;
         //change the label
         bStartMon.Text = "Stop Monitoring";
         //disable the timer too
         AlarmTimer.stop();
         //enable the disable button
         bDiasble.Enabled = true;
     }
 }
        private void bDiasble_Click(object sender, EventArgs e)
        {
            //first stop the alarm
            AlarmPlayer.Stop_Alarm();

            //stop monitoring hudson also
            HudsonMonitor.isMonitoringEnabled = false;
            isMonitoring   = false;
            bStartMon.Text = "Start Monitoring";

            //convert the value to milli-seconds and start the timer
            AlarmTimer.Start(Convert.ToInt32(nAlarmPauseLength.Value) * 1000);
        }