internal ConsoleLineOutput(PSHostUserInterface hostConsole, bool paging, bool lineWrap, TerminatingErrorContext errorContext) { if (hostConsole == null) { throw PSTraceSource.NewArgumentNullException("hostConsole"); } if (errorContext == null) { throw PSTraceSource.NewArgumentNullException("errorContext"); } this.console = hostConsole; this.errorContext = errorContext; if (paging) { tracer.WriteLine("paging is needed", new object[0]); string s = StringUtil.Format(FormatAndOut_out_xxx.ConsoleLineOutput_PagingPrompt, new object[0]); this.prompt = new PromptHandler(s, this); } PSHostRawUserInterface rawUI = this.console.RawUI; if (rawUI != null) { tracer.WriteLine("there is a valid raw interface", new object[0]); this._displayCellsPSHost = new DisplayCellsPSHost(rawUI); } WriteLineHelper.WriteCallback wlc = new WriteLineHelper.WriteCallback(this.OnWriteLine); WriteLineHelper.WriteCallback wc = new WriteLineHelper.WriteCallback(this.OnWrite); if (this.forceNewLine) { this.writeLineHelper = new WriteLineHelper(lineWrap, wlc, null, this.DisplayCells); } else { this.writeLineHelper = new WriteLineHelper(lineWrap, wlc, wc, this.DisplayCells); } }
internal ConsoleLineOutput(PSHostUserInterface hostConsole, bool paging, bool lineWrap, TerminatingErrorContext errorContext) { if (hostConsole == null) { throw PSTraceSource.NewArgumentNullException("hostConsole"); } if (errorContext == null) { throw PSTraceSource.NewArgumentNullException("errorContext"); } this.console = hostConsole; this.errorContext = errorContext; if (paging) { tracer.WriteLine("paging is needed", new object[0]); string s = StringUtil.Format(FormatAndOut_out_xxx.ConsoleLineOutput_PagingPrompt, new object[0]); this.prompt = new PromptHandler(s, this); } PSHostRawUserInterface rawUI = this.console.RawUI; if (rawUI != null) { tracer.WriteLine("there is a valid raw interface", new object[0]); this._displayCellsPSHost = new DisplayCellsPSHost(rawUI); } WriteLineHelper.WriteCallback wlc = new WriteLineHelper.WriteCallback(this.OnWriteLine); WriteLineHelper.WriteCallback wc = new WriteLineHelper.WriteCallback(this.OnWrite); if (this.forceNewLine) { this.writeLineHelper = new WriteLineHelper(lineWrap, wlc, null, this.DisplayCells); } else { this.writeLineHelper = new WriteLineHelper(lineWrap, wlc, wc, this.DisplayCells); } }