System.TermInfoDriver.SetCursorPosition C# (CSharp) Method

SetCursorPosition() public method

public SetCursorPosition ( int left, int top ) : void
left int
top int
return void
		public void SetCursorPosition (int left, int top)
		{
			if (!inited) {
				Init ();
			}

			CheckWindowDimensions ();
			if (left < 0 || left >= bufferWidth)
				throw new ArgumentOutOfRangeException ("left", "Value must be positive and below the buffer width.");

			if (top < 0 || top >= bufferHeight)
				throw new ArgumentOutOfRangeException ("top", "Value must be positive and below the buffer height.");

			// Either CursorAddress or nothing.
			// We might want to play with up/down/left/right/home when ca is not available.
			if (cursorAddress == null)
				throw new NotSupportedException ("This terminal does not suport setting the cursor position.");

			WriteConsole (ParameterizedStrings.Evaluate (cursorAddress, top, left));
			cursorLeft = left;
			cursorTop = top;
		}