If I have an instance of a System.Timers.Timer that has a long interval - say 1 minute, how can I find out if it is started without waiting for the Tick?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
System.Timer.Timer.Enabled
should work, when you call "Start" it sets Enabled to TRUE, "Stop" sets it to FALSE.
回答2:
if (timer1.Enabled)
{
// Do Something
}
回答3:
If Timer.Enabled is true, your timer is running.
Calling Timer.Start sets Enabled to true.
Calling Timer.Stop sets Enabled to false.
If Timer.AutoReset is true, then Enabled will automatically be set to false the first time the timer expires.
回答4:
Use the timer's Enabled property.
回答5:
You should check that timer is enabled