Jason P Sallinger
Jason P Sallinger

Reputation: 226

When starting a Dispatch Timer, is it necessary to stop it first?

Considering the following C# code:

                if (finalTextConvertTimer != null)
                {
                    if (finalTextConvertTimer.IsEnabled)
                    {
                        finalTextConvertTimer.Stop();
                    }
                    finalTextConvertTimer.Start();
                }

Is it necessary to stop the timer first? One developer here says it's not. Just looking for validation.

Upvotes: 0

Views: 281

Answers (1)

Jason P Sallinger
Jason P Sallinger

Reputation: 226

Apologies for not researching in MSDN first. From the method documentation (http://msdn.microsoft.com/en-us/library/system.windows.threading.dispatchertimer.start(v=vs.110).aspx):

Start resets the timer Interval.

Upvotes: 1

Related Questions