コード例 #1
0
 /// <summary>
 /// Sets the position of the window area, relative to the screen buffer.
 /// </summary>
 public static void SetWindowPosition(this IConsole console, ConsolePoint position) => console.SetWindowPosition(position.Left, position.Top);
コード例 #2
0
 /// <summary>
 /// Sets the cursor position to <paramref name="point"/>, executes an operation, and then restores the cursor position to where it was when this method was called.
 /// </summary>
 /// <param name="console">The console on which the action is carried out.</param>
 /// <param name="point">The point to which the cursor position should be shifted temporarily.</param>
 /// <param name="action">The action to execute.</param>
 /// <param name="hideCursor">if set to <c>true</c> the cursor will be hidden while executing <paramref name="action"/>.</param>
 public static void TemporaryShift(this IConsole console, ConsolePoint point, Action <IConsole> action, bool hideCursor = true)
 {
     TemporaryShift(console, c => { c.SetCursorPosition(point); action(c); }, hideCursor);
 }