WaitCursor

Screenshot:
  • none.

Features:
  • Nestable WaitCursor based on IDisposable.

Sample code:
  • Simple section of code guarded by a WaitCursor:
using (WaitCursor wc as new WaitCursor()) {
  //..your code
}
  • Because of the IDisplosable, the WaitCursor object automatically reverts back to the value it had at the start of the using statement. A nice effect of this method is that one can also use it nested like:
using (WaitCursor wc1 as new WaitCursor()) {
   //..your code

   using (WaitCursor wc2 as new WaitCursor()) {
     //..more of your code
   }

   //..even more of your code
}
The inner using statement can also be localed in another method or even library without problems of a premature
reverting to a non waitcursor.

The IDisposable should also be Exception proof.

Last edited Jan 7, 2010 at 2:13 PM by wvd_vegt, version 11

Comments

No comments yet.