Merge pull request #3446 from lambdageek/bug-42584
[mono.git] / mcs / class / corlib / System / NullConsoleDriver.cs
index 49b5e6bca69dcb563eeb0283d3d490f849eed553..09cba85976a2f4357ac85b3ea1aef9c13e367e2f 100644 (file)
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-#if NET_2_0
+#if !MOBILE
 using System.Runtime.InteropServices;
 using System.Text;
 namespace System {
-       class NullConsoleDriver : IConsoleDriver {
+       class NullConsoleDriver : IConsoleDriver
+       {
+               static readonly ConsoleKeyInfo EmptyConsoleKeyInfo = new ConsoleKeyInfo ('\0', 0, false, false, false);
+
                public ConsoleColor BackgroundColor {
                        get { return ConsoleColor.Black; }
                        set {
@@ -71,11 +74,6 @@ namespace System {
                        set {}
                }
 
-               public bool Echo { // not really used on windows
-                       get { return true; }
-                       set {}
-               }
-
                public ConsoleColor ForegroundColor {
                        get { return ConsoleColor.Black; }
                        set {}
@@ -156,7 +154,7 @@ namespace System {
 
                public ConsoleKeyInfo ReadKey (bool intercept)
                {
-                       return ConsoleKeyInfo.Empty;
+                       return EmptyConsoleKeyInfo;
                }
 
                public void ResetColor ()