Windows Live Writer Timer Plug-in

This is the new plug-in I have for Windows Live Writer.  I made it as I was on the thought process of doing my NaNoWriMo novel, on my blog.  Interesting task to say the least and it would also mean perhaps those who occasion my blog might spur me on, spurn my efforts. 

image

It is a simple plug-in, and is one of my more complex plug-ins.  Wait a moment, how is it a simple plugin, yet a complex one.  Well it is complex from the programming stand point.  I chose to you what is a server timer within .NET.  This operates in a similar but a different manner to the traditional control (UI) timer and the difference in their operation is in the way the instances are created.

A UI timer, runs on the UI thread, typically meant for single threaded applications, but the problem with controls on UI threads is that can cause the UI to stop updating if a process takes a long time to process.  A server timer is typically a more reliable timer, it is on a separate thread to the UI Thread and therefore it will not cause issues with the UI updating.

Now, the side that makes it more complex is the cross threaded communication, where the event is raised on one thread but details need to be sent to another thread to perform the update, mainly that of the UI.  Controls aren’t thread safe, therefore care should be taken to determine if you should be updating a control from another thread.

Suffice to say, I know, my controls are all updated from places where I know, therefore I can update the controls safely knowing that I am not going to be causing issues.

Another element that makes this more difficult is the fact that there is also another timer which control the alarm, so 2 threads, different threads need to update controls, or monitor controls on a different thread process.

  • Shows the current time open (which is in case editing time)
  • Shows the TOTAL time editing, which is saved, when you start a new session it will show the total time incrementing as well.
  • Alarm, set this to be an amount of time and the alarm will go off.  There is a stop button that stops the ding sound from running when the alarm goes off. 
  • Will support a maximum of 4,294,967,295 days (that is 11,767,033, yes 11 million years), so making sure that you don’t leave the timer open that long, then things should be OK.

This is just an initial version and I have plans as well for this.

  • Include a recurring alarm which will make the alarm go over every x minutes, seconds and so on.
  • Alarm validation, this is a basic one and I haven’t put it in yet but will be top of my list, so entry can be a little more straight forward and enable the user to know if they can enter that information.
  • Ability to pause/resume the timers and also to stop and reset them.

As with all my plugins, please let me know if you wish to use them and I can then send you the plugin and information on how to install it.  Also if you have any ideas and wish to share them on simple plugins that would make your blogging life easier, let me know and I will see how I can work on it.

Advertisements

Posted on October 31, 2013, in Development, Timer Plug-in and tagged , . Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: