using System; using System.Windows.Forms; namespace Utils { /// /// Summary description for CursorHandler. /// public class CursorHandler : IDisposable { Cursor savedCursor; public CursorHandler() { savedCursor = Cursor.Current; Cursor.Current = Cursors.WaitCursor; } ~CursorHandler() { Restore(); } public void Dispose() { Restore(); GC.SuppressFinalize(this); } private void Restore() { Cursor.Current = savedCursor; } } }