public void SetBufferSize (int width, int height)
{
ConsoleScreenBufferInfo info = new ConsoleScreenBufferInfo ();
GetConsoleScreenBufferInfo (outputHandle, out info);
if (width - 1 > info.Window.Right)
throw new ArgumentOutOfRangeException ("width");
if (height - 1 > info.Window.Bottom)
throw new ArgumentOutOfRangeException ("height");
Coord coord = new Coord (width, height);
if (!SetConsoleScreenBufferSize (outputHandle, coord))
throw new ArgumentOutOfRangeException ("height/width", "Cannot be smaller than the window size.");
}