From db467ba0e8ae3c6199e40dfd658b27cac59b9194 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 20 May 2017 16:03:11 -0400 Subject: [PATCH] document terminal text writer --- ShiftOS_TheReturn/TerminalTextWriter.cs | 31 ++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/ShiftOS_TheReturn/TerminalTextWriter.cs b/ShiftOS_TheReturn/TerminalTextWriter.cs index 55e27cf..010e02c 100644 --- a/ShiftOS_TheReturn/TerminalTextWriter.cs +++ b/ShiftOS_TheReturn/TerminalTextWriter.cs @@ -32,12 +32,22 @@ using System.Windows.Forms; namespace ShiftOS.Engine { + /// + /// Backend class for forwarding to the ShiftOS terminal. + /// public class TerminalTextWriter : TextWriter { + /// + /// Win32 API call to lock the window from being updated. + /// + /// The Win32 window handle + /// ...I....have no idea. [System.Runtime.InteropServices.DllImport("user32.dll")] public static extern bool LockWindowUpdate(IntPtr hWndLock); - + /// + /// Gets the encoding format for this . God bless the Unicode Consortiem. + /// public override Encoding Encoding { get @@ -46,6 +56,9 @@ namespace ShiftOS.Engine } } + /// + /// Gets the underlying that this is forwarding to. + /// public ITerminalWidget UnderlyingControl { get @@ -54,6 +67,9 @@ namespace ShiftOS.Engine } } + /// + /// Moves the caret to the last character in the textbox. + /// public void select() { Desktop.InvokeOnWorkerThread(new Action(() => @@ -63,6 +79,10 @@ namespace ShiftOS.Engine })); } + /// + /// Write a character to the Terminal. + /// + /// The character to write. public override void Write(char value) { if (TerminalBackend.IsForwardingConsoleWrites) @@ -82,6 +102,10 @@ namespace ShiftOS.Engine } } + /// + /// Write text to the Terminal, followed by a newline. + /// + /// The text to write. public override void WriteLine(string value) { if (TerminalBackend.IsForwardingConsoleWrites) @@ -102,10 +126,15 @@ namespace ShiftOS.Engine } } + [Obsolete("Stub.")] public void SetLastText() { } + /// + /// Write text to the Terminal. + /// + /// The text to write. public override void Write(string value) { if (TerminalBackend.IsForwardingConsoleWrites)