Merge pull request #3446 from lambdageek/bug-42584
[mono.git] / mcs / class / corlib / System / NullConsoleDriver.cs
index 4ffabc85a30ca39319c5d8555afdc3d68c362196..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_1
+#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 {
@@ -151,7 +154,7 @@ namespace System {
 
                public ConsoleKeyInfo ReadKey (bool intercept)
                {
-                       return ConsoleKeyInfo.Empty;
+                       return EmptyConsoleKeyInfo;
                }
 
                public void ResetColor ()