I have a method that associates BO Connection.AliveIntervalwith System.Timers.Timer(.NET 2 ).
Connection.AliveInterval
System.Timers.Timer
Some connection is always connected.
Is it possible in this case to establish
if (myConnection.AliveInterval == Connection.TimeInfinite) { myTimer.Interval = double.PositiveInfinity; }
?
Should I expect the timer to throw exceptions or to ever exceed the Elapsed event?
MSDN :
The value must be greater than zero, and less than or equal to Int32.MaxValueAn ArgumentExceptionwill be thrown when the interval is greater than Int32.MaxValue, and the timer is currently on. If the timer is not currently enabled, the exception is not until it is enabled.
The value must be greater than zero, and less than or equal to Int32.MaxValue
An ArgumentExceptionwill be thrown when the interval is greater than Int32.MaxValue, and the timer is currently on. If the timer is not currently enabled, the exception is not until it is enabled.
ArgumentException
, PositiveInfinity , .
PositiveInfinity
PositiveInfinity. ArgumentException PositiveInfinity.
, , MonoDevelop VS System.Timers.Timer:
, .
Int32, UInt32 TimeSpan. , Infinite.
Int32
UInt32
TimeSpan
Infinite
Timeout.Infinite .
Timeout.Infinite
, :
-. , .
. , , . myTimer.Stop(), @spender myTimer.Enabled = false, @Bolu.
myTimer.Stop()
myTimer.Enabled = false
Why not myTimer.Stop()?
Source: https://habr.com/ru/post/1768966/More articles:Stdout java program and foreground disconnect - redirectDoes the statistic mean :: The descriptive method of percentiles is documented? - statisticsSetting DropDown List Width for DataGridView ComboBoxColumn - WinForms - c #Associations with Doctrine PHP - databasehttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1768965/free-code-metrics-tool-for-net-should-be-callable-directly-from-nant-via-console&usg=ALkJrhjnDAFC-PmgnZk2mRgk28o0f04YLQiPhone, an object on a picket sheet, how can I determine when an action sheet is closed / fired? - iphoneMigrating from ASP.NET MVC to Java - javaiPhone - How to recognize iTunes user of my application - iphoneDjango South migration error "contains null values" with field null = True - djangoReturning an iterator in a multi-threaded environment is a good idea? - c ++All Articles