From f8bd1243b68570869c52135d00939fbdba090dfd Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Wed, 4 Nov 2015 09:42:59 -0800 Subject: [PATCH] Clean up --- src/host/main.cs | 15 +++++---------- src/host/rawui.cs | 43 +++++++++++++++++++++---------------------- src/host/readline.cs | 20 ++++++++++---------- 3 files changed, 36 insertions(+), 42 deletions(-) diff --git a/src/host/main.cs b/src/host/main.cs index 5e486ed952..350dfec21f 100644 --- a/src/host/main.cs +++ b/src/host/main.cs @@ -87,8 +87,8 @@ namespace Microsoft.Samples.PowerShell.Host for (int i = 0; i < args.Length; ++i) { string arg = args[i]; - bool hasNext = (i+1) @@ -89,8 +90,8 @@ namespace Microsoft.Samples.PowerShell.Host /// public override bool KeyAvailable { - get { return false; } - // get { return Console.KeyAvailable; } + get { return false; } + // get { return Console.KeyAvailable; } } /// @@ -102,8 +103,8 @@ namespace Microsoft.Samples.PowerShell.Host /// public override Size MaxPhysicalWindowSize { - // get { return new Size(Console.LargestWindowWidth, Console.LargestWindowHeight); } - get { return new Size(1024,768); } + // get { return new Size(Console.LargestWindowWidth, Console.LargestWindowHeight); } + get { return new Size(1024,768); } } /// @@ -114,8 +115,8 @@ namespace Microsoft.Samples.PowerShell.Host /// public override Size MaxWindowSize { - // get { return new Size(Console.LargestWindowWidth, Console.LargestWindowHeight); } - get { return new Size(1024,768); } + // get { return new Size(Console.LargestWindowWidth, Console.LargestWindowHeight); } + get { return new Size(1024,768); } } /// @@ -125,8 +126,8 @@ namespace Microsoft.Samples.PowerShell.Host /// public override Coordinates WindowPosition { - // get { return new Coordinates(Console.WindowLeft, Console.WindowTop); } - // set { Console.SetWindowPosition(value.X, value.Y); } + // get { return new Coordinates(Console.WindowLeft, Console.WindowTop); } + // set { Console.SetWindowPosition(value.X, value.Y); } get { return new Coordinates(0,0); } set { } } @@ -138,8 +139,8 @@ namespace Microsoft.Samples.PowerShell.Host /// public override Size WindowSize { - // get { return new Size(Console.WindowWidth, Console.WindowHeight); } - // set { Console.SetWindowSize(value.Width, value.Height); } + // get { return new Size(Console.WindowWidth, Console.WindowHeight); } + // set { Console.SetWindowSize(value.Width, value.Height); } get { return new Size(1024,768); } set { } } @@ -150,8 +151,8 @@ namespace Microsoft.Samples.PowerShell.Host /// public override string WindowTitle { - // get { return Console.Title; } - // set { Console.Title = value; } + // get { return Console.Title; } + // set { Console.Title = value; } get { return "window title"; } set { } } @@ -174,7 +175,7 @@ namespace Microsoft.Samples.PowerShell.Host public override BufferCell[,] GetBufferContents(Rectangle rectangle) { throw new NotImplementedException( - "The method or operation is not implemented."); + "The method or operation is not implemented."); } /// @@ -190,7 +191,7 @@ namespace Microsoft.Samples.PowerShell.Host public override KeyInfo ReadKey(ReadKeyOptions options) { throw new NotImplementedException( - "The method or operation is not implemented."); + "The method or operation is not implemented."); } /// @@ -206,7 +207,7 @@ namespace Microsoft.Samples.PowerShell.Host public override void ScrollBufferContents(Rectangle source, Coordinates destination, Rectangle clip, BufferCell fill) { throw new NotImplementedException( - "The method or operation is not implemented."); + "The method or operation is not implemented."); } /// @@ -220,7 +221,7 @@ namespace Microsoft.Samples.PowerShell.Host BufferCell[,] contents) { throw new NotImplementedException( - "The method or operation is not implemented."); + "The method or operation is not implemented."); } /// @@ -233,9 +234,7 @@ namespace Microsoft.Samples.PowerShell.Host public override void SetBufferContents(Rectangle rectangle, BufferCell fill) { throw new NotImplementedException( - "The method or operation is not implemented."); + "The method or operation is not implemented."); } } - } - diff --git a/src/host/readline.cs b/src/host/readline.cs index b1893029e7..324638d6dc 100644 --- a/src/host/readline.cs +++ b/src/host/readline.cs @@ -49,28 +49,28 @@ namespace Microsoft.Samples.PowerShell.Host public ConsoleReadLine() { this.tokenColors = new ConsoleColor[] - { - this.defaultColor, // Unknown + { + this.defaultColor, // Unknown ConsoleColor.Yellow, // Command ConsoleColor.Green, // CommandParameter ConsoleColor.Cyan, // CommandArgument ConsoleColor.Cyan, // Number ConsoleColor.Cyan, // String ConsoleColor.Green, // Variable - this.defaultColor, // Member - this.defaultColor, // LoopLabel + this.defaultColor, // Member + this.defaultColor, // LoopLabel ConsoleColor.DarkYellow, // Attribute ConsoleColor.DarkYellow, // Type ConsoleColor.DarkCyan, // Operator - this.defaultColor, // GroupStart - this.defaultColor, // GroupEnd + this.defaultColor, // GroupStart + this.defaultColor, // GroupEnd ConsoleColor.Magenta, // Keyword ConsoleColor.Red, // Comment ConsoleColor.DarkCyan, // StatementSeparator - this.defaultColor, // NewLine - this.defaultColor, // LineContinuation - this.defaultColor, // Position - }; + this.defaultColor, // NewLine + this.defaultColor, // LineContinuation + this.defaultColor, // Position + }; } ///