Wednesday, April 28, 2010

Wait Timer for Commands in TaskDialog library

I’ve got several requests to implement timer functionality in TaskDialog commands. The latest code drop contains requested changes. This is a preliminary design and I invite a discussion on implementation which would cover the most common use cases.
Here are the main points of current implementation:
  • TaskDialog.Command interface now includes getWaitInterval function which should return required wait interval in seconds.
  • TaskDialog.StandardCommand by default returns 0, but includes new variant of the derive function with additional waitInterval parameter. This allows for adding custom commands with specified wait interval.
How would we do it with our very convenient methods from TaskDialogs class? By passing special commands with instruction text. Following will show a warning dialog with wait interval of 10 seconds.


This works on all TaskDialogs methods except choice and showException. My current feeling is that more work is required to make it perfect.
As always… Your comments and suggestions are welcome :) The project is available at under BSD license.

No comments:

Post a Comment