用于简化光标变换代码的编写
/// <summary>/// 用于简化光标变换代码的编写
/// 用法:
/// using(new MyCursor())
/// {
/// // 执行操作....
/// }
/// </summary>
public class MyCursor : IDisposable
{
private Cursor m_OriginalCursor = null;
public MyCursor()
{
m_OriginalCursor = Cursor.Current;
Cursor.Current = Cursors.WaitCursor;
}
public MyCursor(Cursor aCursor)
{
m_OriginalCursor = Cursor.Current;
Cursor.Current = aCursor;
}
public void Dispose()
{
Cursor.Current = m_OriginalCursor;
m_OriginalCursor = null;
}
}
页:
[1]