nothingmn/AGENT.Contrib — pull request #6 by FrenchData (2013-07-04 21:58:47+00:00)
Title: Dynamic refresh period

Hello,

I made a small change to WatchFace.cs in order to make the internal timer's period dynamic.

The idea is to check at each tick if the UpdateSpeed of the face has changed and to set the timer's period accordingly. I had a use for this by implementing a StopWatch face. When the stopwatch is running, I need a very short update frequency. But when the stopwatch is not running, I can go with a longer frequency. I suppose this can have a positive impact on battery life.

I'm a little unpleased by the fact that the code will check the UpdateSpeed property at each Render. Better, but more invasive option, would be that IFace exposes an event "UpdateSpeedChanged" and that WatchFace subscribes to this event.

This would, however, I think, be a breaking change. So I prefer to check with you what you think about it. Feel free to contact me if you want to discuss the topic.

Philippe HERTZOG