/// <summary> /// Moves the cursor temporarely to another position /// then restores the position once disposed /// </summary> /// <param name="Left">The Left value to move to</param> /// <param name="Top">The Top value to move to</param> public TemporaryCursorMove(Int32 Left, Int32 Top) { // Saves the current position this.Left = BConsole.CursorLeft; this.Top = BConsole.CursorTop; // Moves the cursor to the provided position if we are on a console BConsole.SetCursorPosition(Left, Top); }
public void Dispose( ) { // Moves the cursor back to where it was BConsole.SetCursorPosition(Left, Top); GC.SuppressFinalize(this); }