コード例 #1
0
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (msTz0WmiInstance != null)
         {
             msTz0WmiInstance.Dispose();
         }
         clevoWmiInstance.Dispose();
         timerFan.Dispose();
         timerUI.Stop();
         timerUI.Dispose();
         notifyIcon.Visible = false;
         notifyIcon.Dispose();
         canvas.Dispose();
         icon.Dispose();
         iconBitmap.Dispose();
         font.Dispose();
         brushBg.Dispose();
         brushFg.Dispose();
         brushText.Dispose();
         brushDrop.Dispose();
         penLine.Dispose();
     }
     base.Dispose(disposing);
 }
コード例 #2
0
 private void frmWaitMessage_FormClosing(object sender, FormClosingEventArgs e)
 {
     updateTimer.Stop();
     if (connectionexception != null)
     {
         MessageBox.Show("Connection Exception:" + connectionexception.Message);
         Application.Exit();
     }
 }
コード例 #3
0
ファイル: CreateIssue.cs プロジェクト: Tdue21/JiraConnector
 // I have no idea why just calling BringToFront does not work, but it does not. Go figure
 private void bringDialogToFront()
 {
     try {
         TopMost = true;
         System.Windows.Forms.Timer t = new System.Windows.Forms.Timer {
             Interval = 100
         };
         t.Tick += (s, e) => { TopMost = false; t.Stop(); };
         t.Start();
     } catch (Exception e) {
         // in case somebody closes the dialog before the timer fires up
         Debug.WriteLine("CreateIssue.bringDialogToFront() - exception: " + e.Message);
     }
 }
コード例 #4
0
        private void SsTimerOnTick(object sender, EventArgs eventArgs)
        {
            var active = 1;

            SystemParametersInfo(SPI_GETSCREENSAVERRUNNING, 0, ref active, 0);

            if (active != 0)
            {
                return;
            }

            _ssTimer.Stop();
            this.WriteLog("Screensaver off. Start timer...");
            StartTimer();
        }
コード例 #5
0
ファイル: Program.cs プロジェクト: Vladdden/TimersMultiThread
 static void SomeFuncForTimerWF(Object source, EventArgs e)
 {
     Console.WriteLine("Timer TimerWF is working!");
     TimerWF.Stop();
     TimerWF.Dispose();
 }