2 // System.NullConsoleDriver
5 // Gonzalo Paniagua Javier (gonzalo@ximian.com)
7 // (C) 2006 Novell, Inc. (http://www.novell.com)
10 // Permission is hereby granted, free of charge, to any person obtaining
11 // a copy of this software and associated documentation files (the
12 // "Software"), to deal in the Software without restriction, including
13 // without limitation the rights to use, copy, modify, merge, publish,
14 // distribute, sublicense, and/or sell copies of the Software, and to
15 // permit persons to whom the Software is furnished to do so, subject to
16 // the following conditions:
18 // The above copyright notice and this permission notice shall be
19 // included in all copies or substantial portions of the Software.
21 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
24 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
25 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
26 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
27 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
30 using System.Runtime.InteropServices;
33 class NullConsoleDriver : IConsoleDriver
35 static readonly ConsoleKeyInfo EmptyConsoleKeyInfo = new ConsoleKeyInfo ('\0', 0, false, false, false);
37 public ConsoleColor BackgroundColor {
38 get { return ConsoleColor.Black; }
43 public int BufferHeight {
48 public int BufferWidth {
53 public bool CapsLock {
57 public int CursorLeft {
62 public int CursorSize {
67 public int CursorTop {
72 public bool CursorVisible {
77 public ConsoleColor ForegroundColor {
78 get { return ConsoleColor.Black; }
82 public bool KeyAvailable {
83 get { return false; } // FIXME: throw?
86 public bool Initialized {
90 public int LargestWindowHeight {
94 public int LargestWindowWidth {
98 public bool NumberLock {
102 public string Title {
107 public bool TreatControlCAsInput {
108 get { return false; }
112 public int WindowHeight {
117 public int WindowLeft {
122 public int WindowTop {
127 public int WindowWidth {
132 public void Beep (int frequency, int duration)
140 public void MoveBufferArea (int sourceLeft, int sourceTop, int sourceWidth, int sourceHeight,
141 int targetLeft, int targetTop, Char sourceChar,
142 ConsoleColor sourceForeColor, ConsoleColor sourceBackColor)
150 public string ReadLine ()
155 public ConsoleKeyInfo ReadKey (bool intercept)
157 return EmptyConsoleKeyInfo;
160 public void ResetColor ()
164 public void SetBufferSize (int width, int height)
168 public void SetCursorPosition (int left, int top)
172 public void SetWindowPosition (int left, int top)
176 public void SetWindowSize (int width, int height)