1 | #Region "Microsoft.VisualBasic::c08c74a1b5e60c7ce11f1c1dfbde7b00, Microsoft.VisualBasic.Core\ApplicationServices\Terminal\InteractiveIODevice\Terminal.vb" |
2 | |
3 | ' Author: |
4 | ' |
5 | ' asuka (amethyst.asuka@gcmodeller.org) |
6 | ' xie (genetics@smrucc.org) |
7 | ' xieguigang (xie.guigang@live.com) |
8 | ' |
9 | ' Copyright (c) 2018 GPL3 Licensed |
10 | ' |
11 | ' |
12 | ' GNU GENERAL PUBLIC LICENSE (GPL3) |
13 | ' |
14 | ' |
15 | ' This program is free software: you can redistribute it and/or modify |
16 | ' it under the terms of the GNU General Public License as published by |
17 | ' the Free Software Foundation, either version 3 of the License, or |
18 | ' (at your option) any later version. |
19 | ' |
20 | ' This program is distributed in the hope that it will be useful, |
21 | ' but WITHOUT ANY WARRANTY; without even the implied warranty of |
22 | ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
23 | ' GNU General Public License for more details. |
24 | ' |
25 | ' You should have received a copy of the GNU General Public License |
26 | ' along with this program. If not, see <http://www.gnu.org/licenses/>. |
27 | |
28 | |
29 | |
30 | ' /********************************************************************************/ |
31 | |
32 | ' Summaries: |
33 | |
34 | ' Class Terminal |
35 | ' |
36 | ' Properties: [Error], [In], BackgroundColor, BufferHeight, BufferWidth |
37 | ' CapsLock, CursorLeft, CursorSize, CursorTop, CursorVisible |
38 | ' ForegroundColor, InputEncoding, IsErrorRedirected, IsInputRedirected, IsOutputRedirected |
39 | ' KeyAvailable, LargestWindowHeight, LargestWindowWidth, NumberLock, Out |
40 | ' OutputEncoding, Title, TreatControlCAsInput, WindowHeight, WindowLeft |
41 | ' WindowTop, WindowWidth |
42 | ' |
43 | ' Function: (+2 Overloads) OpenStandardError, (+2 Overloads) OpenStandardInput, (+2 Overloads) OpenStandardOutput, Read, (+2 Overloads) ReadKey |
44 | ' ReadLine |
45 | ' |
46 | ' Sub: (+2 Overloads) Beep, Clear, (+2 Overloads) MoveBufferArea, ResetColor, SetBufferSize |
47 | ' SetCursorPosition, SetError, SetIn, SetOut, SetWindowPosition |
48 | ' SetWindowSize, (+17 Overloads) Write, (+19 Overloads) WriteLine |
49 | ' |
50 | ' |
51 | ' /********************************************************************************/ |
52 | |
53 | #End Region |
54 | |
55 | Imports STDIO = System.Console |
56 | |
57 | Namespace Terminal |
58 | |
59 | ''' <summary> |
60 | ''' Represents the standard input, output, and error streams for console applications. 交互式的命令行终端 |
61 | ''' </summary> |
62 | ''' <remarks></remarks> |
63 | Public MustInherit Class Terminal : Implements STDIO__.I_ConsoleDeviceHandle |
64 | |
65 | #Region "Console Member Inherits Details" |
66 | |
67 | #Region "Public Methods" |
68 | |
69 | ''' <summary> |
70 | ''' Plays the sound of a beep through the console speaker. |
71 | ''' </summary> |
72 | ''' <remarks></remarks> |
73 | ''' <exception cref="System.Security.HostProtectionException">System.Security.HostProtectionException: This method was executed on a server, such as SQL Server, that does not permit access to a user interface.</exception> |
74 | Public Sub Beep() |
75 | Call Console.Beep() |
76 | End Sub |
77 | |
78 | ''' <summary> |
79 | ''' Plays the sound of a beep of a specified frequency and duration through the console speaker. |
80 | ''' </summary> |
81 | ''' <param name="frequency">The frequency of the beep, ranging from 37 to 32767 hertz.</param> |
82 | ''' <param name="duration">The duration of the beep measured in milliseconds.</param> |
83 | ''' <remarks></remarks> |
84 | ''' <exception cref="System.ArgumentOutOfRangeException">frequency is less than 37 or more than 32767 hertz.-or-duration is less than or equal to zero.</exception> |
85 | ''' <exception cref="System.Security.HostProtectionException">This method was executed on a server, such as SQL Server, that does not permit access to the console.</exception> |
86 | Public Sub Beep(frequency As Integer, duration As Integer) |
87 | Call Console.Beep(frequency, duration) |
88 | End Sub |
89 | |
90 | ''' <summary> |
91 | ''' Clears the console buffer and corresponding console window of display information. |
92 | ''' </summary> |
93 | ''' <remarks></remarks> |
94 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
95 | Public Sub Clear() |
96 | Call Console.Clear() |
97 | End Sub |
98 | |
99 | ''' <summary> |
100 | ''' Copies a specified source area of the screen buffer to a specified destination area. |
101 | ''' </summary> |
102 | ''' <param name="sourceLeft">The leftmost column of the source area.</param> |
103 | ''' <param name="sourceTop">The topmost row of the source area.</param> |
104 | ''' <param name="sourceWidth">The number of columns in the source area.</param> |
105 | ''' <param name="sourceHeight">The number of rows in the source area.</param> |
106 | ''' <param name="targetLeft">The leftmost column of the destination area.</param> |
107 | ''' <param name="targetTop">The topmost row of the destination area.</param> |
108 | ''' <remarks></remarks> |
109 | ''' <exception cref="System.ArgumentOutOfRangeException">One or more of the parameters is less than zero.-or- sourceLeft or targetLeft is greater than or equal to System.Console.BufferWidth.-or- sourceTop or targetTop is greater than or equal to System.Console.BufferHeight.-or- sourceTop + sourceHeight is greater than or equal to System.Console.BufferHeight.-or- sourceLeft + sourceWidth is greater than or equal to System.Console.BufferWidth.</exception> |
110 | ''' <exception cref="System.Security.SecurityException">The user does not have permission to perform this action.</exception> |
111 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
112 | Public Sub MoveBufferArea(sourceLeft As Integer, sourceTop As Integer, sourceWidth As Integer, sourceHeight As Integer, targetLeft As Integer, targetTop As Integer) |
113 | Call Console.MoveBufferArea(sourceLeft, sourceTop, sourceWidth, sourceHeight, targetLeft, targetTop) |
114 | End Sub |
115 | |
116 | ''' <summary> |
117 | ''' Copies a specified source area of the screen buffer to a specified destination area. |
118 | ''' </summary> |
119 | ''' <param name="sourceLeft">The leftmost column of the source area.</param> |
120 | ''' <param name="sourceTop">The topmost row of the source area.</param> |
121 | ''' <param name="sourceWidth">The number of columns in the source area.</param> |
122 | ''' <param name="sourceHeight">The number of rows in the source area.</param> |
123 | ''' <param name="targetLeft">The leftmost column of the destination area.</param> |
124 | ''' <param name="targetTop">The topmost row of the destination area.</param> |
125 | ''' <param name="sourceChar">The character used to fill the source area.</param> |
126 | ''' <param name="sourceForeColor">The foreground color used to fill the source area.</param> |
127 | ''' <param name="sourceBackColor">The background color used to fill the source area.</param> |
128 | ''' <remarks></remarks> |
129 | ''' <exception cref="System.ArgumentOutOfRangeException">One or more of the parameters is less than zero.-or- sourceLeft or targetLeft is greater than or equal to System.Console.BufferWidth.-or- sourceTop or targetTop is greater than or equal to System.Console.BufferHeight.-or- sourceTop + sourceHeight is greater than or equal to System.Console.BufferHeight.-or- sourceLeft + sourceWidth is greater than or equal to System.Console.BufferWidth.</exception> |
130 | ''' <exception cref="System.ArgumentException">One or both of the color parameters is not a member of the System.ConsoleColor enumeration.</exception> |
131 | ''' <exception cref="System.Security.SecurityException">The user does not have permission to perform this action.</exception> |
132 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
133 | Public Sub MoveBufferArea(sourceLeft As Integer, sourceTop As Integer, sourceWidth As Integer, sourceHeight As Integer, targetLeft As Integer, targetTop As Integer, sourceChar As Char, sourceForeColor As System.ConsoleColor, sourceBackColor As System.ConsoleColor) |
134 | Call Console.MoveBufferArea(sourceLeft, sourceTop, sourceWidth, sourceHeight, targetLeft, targetTop, sourceChar, sourceForeColor, sourceBackColor) |
135 | End Sub |
136 | |
137 | ''' <summary> |
138 | ''' Sets the foreground and background console colors to their defaults. |
139 | ''' </summary> |
140 | ''' <remarks></remarks> |
141 | ''' <exception cref="System.Security.SecurityException">The user does not have permission to perform this action.</exception> |
142 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
143 | Public Sub ResetColor() |
144 | Call Console.ResetColor() |
145 | End Sub |
146 | |
147 | ''' <summary> |
148 | ''' Sets the height and width of the screen buffer area to the specified values. |
149 | ''' </summary> |
150 | ''' <param name="width">The width of the buffer area measured in columns.</param> |
151 | ''' <param name="height">The height of the buffer area measured in rows.</param> |
152 | ''' <remarks></remarks> |
153 | ''' <exception cref="System.ArgumentOutOfRangeException">height or width is less than or equal to zero.-or- height or width is greater than or equal to System.Int16.MaxValue.-or- width is less than System.Console.WindowLeft + System.Console.WindowWidth.-or- height is less than System.Console.WindowTop + System.Console.WindowHeight.</exception> |
154 | ''' <exception cref="System.Security.SecurityException">The user does not have permission to perform this action.</exception> |
155 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
156 | Public Sub SetBufferSize(width As Integer, height As Integer) |
157 | Call Console.SetBufferSize(width, height) |
158 | End Sub |
159 | |
160 | ''' <summary> |
161 | ''' Sets the position of the cursor. |
162 | ''' </summary> |
163 | ''' <param name="left">The column position of the cursor.</param> |
164 | ''' <param name="top">The row position of the cursor.</param> |
165 | ''' <remarks></remarks> |
166 | ''' <exception cref="System.ArgumentOutOfRangeException">left or top is less than zero.-or- left is greater than or equal to System.Console.BufferWidth.-or- top is greater than or equal to System.Console.BufferHeight.</exception> |
167 | ''' <exception cref="System.Security.SecurityException">The user does not have permission to perform this action.</exception> |
168 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
169 | Public Sub SetCursorPosition(left As Integer, top As Integer) |
170 | Call Console.SetCursorPosition(left, top) |
171 | End Sub |
172 | |
173 | ''' <summary> |
174 | ''' Sets the System.Console.Error property to the specified System.IO.TextWriter object. |
175 | ''' </summary> |
176 | ''' <param name="newError">A stream that is the new standard error output.</param> |
177 | ''' <remarks></remarks> |
178 | ''' <exception cref="System.ArgumentNullException">newError is null.</exception> |
179 | ''' <exception cref="System.Security.SecurityException">The caller does not have the required permission.</exception> |
180 | Public Sub SetError(newError As System.IO.TextWriter) |
181 | Call Console.SetError(newError) |
182 | End Sub |
183 | |
184 | ''' <summary> |
185 | ''' Sets the System.Console.In property to the specified System.IO.TextReader object. |
186 | ''' </summary> |
187 | ''' <param name="newIn">A stream that is the new standard input.</param> |
188 | ''' <remarks></remarks> |
189 | ''' <exception cref="System.ArgumentNullException">newIn is null.</exception> |
190 | ''' <exception cref="System.Security.SecurityException">The caller does not have the required permission.</exception> |
191 | Public Sub SetIn(newIn As System.IO.TextReader) |
192 | Call Console.SetIn(newIn) |
193 | End Sub |
194 | |
195 | ''' <summary> |
196 | ''' Sets the System.Console.Out property to the specified System.IO.TextWriter object. |
197 | ''' </summary> |
198 | ''' <param name="newOut">A stream that is the new standard output.</param> |
199 | ''' <remarks></remarks> |
200 | ''' <exception cref="System.ArgumentNullException">newOut is null.</exception> |
201 | ''' <exception cref="System.Security.SecurityException">The caller does not have the required permission.</exception> |
202 | Public Sub SetOut(newOut As System.IO.TextWriter) |
203 | Call Console.SetOut(newOut) |
204 | End Sub |
205 | |
206 | ''' <summary> |
207 | ''' Sets the position of the console window relative to the screen buffer. |
208 | ''' </summary> |
209 | ''' <param name="left">The column position of the upper left corner of the console window.</param> |
210 | ''' <param name="top">The row position of the upper left corner of the console window.</param> |
211 | ''' <remarks></remarks> |
212 | ''' <exception cref="System.ArgumentOutOfRangeException">left or top is less than zero.-or- left + System.Console.WindowWidth is greater than System.Console.BufferWidth.-or- top + System.Console.WindowHeight is greater than System.Console.BufferHeight.</exception> |
213 | ''' <exception cref="System.Security.SecurityException">The user does not have permission to perform this action.</exception> |
214 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
215 | Public Sub SetWindowPosition(left As Integer, top As Integer) |
216 | Call Console.SetWindowPosition(left, top) |
217 | End Sub |
218 | |
219 | ''' <summary> |
220 | ''' Sets the height and width of the console window to the specified values. |
221 | ''' </summary> |
222 | ''' <param name="width">The width of the console window measured in columns.</param> |
223 | ''' <param name="height">The height of the console window measured in rows.</param> |
224 | ''' <remarks></remarks> |
225 | ''' <exception cref="System.ArgumentOutOfRangeException">width or height is less than or equal to zero.-or- width plus System.Console.WindowLeft or height plus System.Console.WindowTop is greater than or equal to System.Int16.MaxValue. -or-width or height is greater than the largest possible window width or height for the current screen resolution and console font.</exception> |
226 | ''' <exception cref="System.Security.SecurityException">The user does not have permission to perform this action.</exception> |
227 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
228 | Public Sub SetWindowSize(width As Integer, height As Integer) |
229 | Call Console.SetWindowSize(width, height) |
230 | End Sub |
231 | |
232 | ''' <summary> |
233 | ''' Writes the text representation of the specified Boolean value to the standard output stream. |
234 | ''' </summary> |
235 | ''' <param name="value">The value to write.</param> |
236 | ''' <remarks></remarks> |
237 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
238 | Public Sub Write(value As Boolean) |
239 | Call Console.Write(value) |
240 | End Sub |
241 | |
242 | ''' <summary> |
243 | ''' Writes the specified array of Unicode characters to the standard output stream. |
244 | ''' </summary> |
245 | ''' <param name="buffer">A Unicode character array.</param> |
246 | ''' <remarks></remarks> |
247 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
248 | Public Sub Write(buffer() As Char) |
249 | Call Console.Write(buffer) |
250 | End Sub |
251 | |
252 | ''' <summary> |
253 | ''' Writes the specified subarray of Unicode characters to the standard output stream. |
254 | ''' </summary> |
255 | ''' <param name="buffer">An array of Unicode characters.</param> |
256 | ''' <param name="index">The starting position in buffer.</param> |
257 | ''' <param name="count">The number of characters to write.</param> |
258 | ''' <remarks></remarks> |
259 | ''' <exception cref="System.ArgumentNullException">buffer is null.</exception> |
260 | ''' <exception cref="System.ArgumentOutOfRangeException">index or count is less than zero.</exception> |
261 | ''' <exception cref="System.ArgumentException">index plus count specify a position that is not within buffer.</exception> |
262 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
263 | Public Sub Write(buffer() As Char, index As Integer, count As Integer) |
264 | Call Console.Write(buffer, index, count) |
265 | End Sub |
266 | |
267 | ''' <summary> |
268 | ''' Writes the specified Unicode character value to the standard output stream. |
269 | ''' </summary> |
270 | ''' <param name="value">The value to write.</param> |
271 | ''' <remarks></remarks> |
272 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
273 | Public Sub Write(value As Char) |
274 | Call Console.Write(value) |
275 | End Sub |
276 | |
277 | ''' <summary> |
278 | ''' Writes the text representation of the specified System.Decimal value to the standard output stream. |
279 | ''' </summary> |
280 | ''' <param name="value">The value to write.</param> |
281 | ''' <remarks></remarks> |
282 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
283 | Public Sub Write(value As Decimal) |
284 | Call Console.Write(value) |
285 | End Sub |
286 | |
287 | ''' <summary> |
288 | ''' Writes the text representation of the specified double-precision floating-point value to the standard output stream. |
289 | ''' </summary> |
290 | ''' <param name="value">The value to write.</param> |
291 | ''' <remarks></remarks> |
292 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
293 | Public Sub Write(value As Double) |
294 | Call Console.Write(value) |
295 | End Sub |
296 | |
297 | ''' <summary> |
298 | ''' Writes the text representation of the specified 32-bit signed integer value to the standard output stream. |
299 | ''' </summary> |
300 | ''' <param name="value">The value to write.</param> |
301 | ''' <remarks></remarks> |
302 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
303 | Public Sub Write(value As Integer) |
304 | Call Console.Write(value) |
305 | End Sub |
306 | |
307 | ''' <summary> |
308 | ''' Writes the text representation of the specified 64-bit signed integer value to the standard output stream. |
309 | ''' </summary> |
310 | ''' <param name="value">The value to write.</param> |
311 | ''' <remarks></remarks> |
312 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
313 | Public Sub Write(value As Long) |
314 | Call Console.Write(value) |
315 | End Sub |
316 | |
317 | ''' <summary> |
318 | ''' Writes the text representation of the specified object to the standard output stream. |
319 | ''' </summary> |
320 | ''' <param name="value">The value to write, or null.</param> |
321 | ''' <remarks></remarks> |
322 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
323 | Public Sub Write(value As Object) |
324 | Call Console.Write(value) |
325 | End Sub |
326 | |
327 | ''' <summary> |
328 | ''' Writes the text representation of the specified single-precision floating-point value to the standard output stream. |
329 | ''' </summary> |
330 | ''' <param name="value">The value to write.</param> |
331 | ''' <remarks></remarks> |
332 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
333 | Public Sub Write(value As Single) |
334 | Call Console.Write(value) |
335 | End Sub |
336 | |
337 | ''' <summary> |
338 | ''' Writes the specified string value to the standard output stream. |
339 | ''' </summary> |
340 | ''' <param name="value">The value to write.</param> |
341 | ''' <remarks></remarks> |
342 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
343 | Public Sub Write(value As String) |
344 | Call Console.Write(value) |
345 | End Sub |
346 | |
347 | ''' <summary> |
348 | ''' Writes the text representation of the specified object to the standard output stream using the specified format information. |
349 | ''' </summary> |
350 | ''' <param name="format">A composite format string (see Remarks).</param> |
351 | ''' <param name="arg0">An object to write using format.</param> |
352 | ''' <remarks></remarks> |
353 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
354 | ''' <exception cref="System.ArgumentNullException">format is null.</exception> |
355 | ''' <exception cref="System.FormatException">The format specification in format is invalid.</exception> |
356 | Public Sub Write(format As String, arg0 As Object) |
357 | Call Console.Write(format, arg0) |
358 | End Sub |
359 | |
360 | ''' <summary> |
361 | ''' Writes the text representation of the specified objects to the standard output stream using the specified format information. |
362 | ''' </summary> |
363 | ''' <param name="format">A composite format string (see Remarks).</param> |
364 | ''' <param name="arg0">The first object to write using format.</param> |
365 | ''' <param name="arg1">The second object to write using format.</param> |
366 | ''' <remarks></remarks> |
367 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
368 | ''' <exception cref="System.ArgumentNullException">format is null.</exception> |
369 | ''' <exception cref="System.FormatException">The format specification in format is invalid.</exception> |
370 | Public Sub Write(format As String, arg0 As Object, arg1 As Object) |
371 | Call Console.Write(format, arg0, arg1) |
372 | End Sub |
373 | |
374 | ''' <summary> |
375 | ''' Writes the text representation of the specified objects to the standard output stream using the specified format information. |
376 | ''' </summary> |
377 | ''' <param name="format">A composite format string (see Remarks).</param> |
378 | ''' <param name="arg0">The first object to write using format.</param> |
379 | ''' <param name="arg1">The second object to write using format.</param> |
380 | ''' <param name="arg2">The third object to write using format.</param> |
381 | ''' <remarks></remarks> |
382 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
383 | ''' <exception cref="System.ArgumentNullException">format is null.</exception> |
384 | ''' <exception cref="System.FormatException">The format specification in format is invalid.</exception> |
385 | Public Sub Write(format As String, arg0 As Object, arg1 As Object, arg2 As Object) |
386 | Call Console.Write(format, arg0, arg1, arg2) |
387 | End Sub |
388 | |
389 | ''' <summary> |
390 | ''' Writes the text representation of the specified array of objects to the standard output stream using the specified format information. |
391 | ''' </summary> |
392 | ''' <param name="format">A composite format string (see Remarks).</param> |
393 | ''' <param name="arg">An array of objects to write using format.</param> |
394 | ''' <remarks></remarks> |
395 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
396 | ''' <exception cref="System.ArgumentNullException">format or arg is null.</exception> |
397 | ''' <exception cref="System.FormatException">The format specification in format is invalid.</exception> |
398 | Public Sub Write(format As String, ParamArray arg() As Object) |
399 | Call Console.Write(format, arg) |
400 | End Sub |
401 | |
402 | ''' <summary> |
403 | ''' Writes the text representation of the specified array of objects to the standard output stream using the specified format information. |
404 | ''' </summary> |
405 | ''' <param name="format">A composite format string (see Remarks).</param> |
406 | ''' <param name="args">An array of objects to write using format.</param> |
407 | ''' <remarks></remarks> |
408 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
409 | ''' <exception cref="System.ArgumentNullException">format or arg is null.</exception> |
410 | ''' <exception cref="System.FormatException">The format specification in format is invalid.</exception> |
411 | Public Overridable Sub WriteLine(format As String, ParamArray args() As String) Implements STDIO__.I_ConsoleDeviceHandle.WriteLine |
412 | Call Console.WriteLine(format, args) |
413 | End Sub |
414 | |
415 | ''' <summary> |
416 | ''' Writes the text representation of the specified 32-bit unsigned integer value to the standard output stream. |
417 | ''' </summary> |
418 | ''' <param name="value">The value to write.</param> |
419 | ''' <remarks></remarks> |
420 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
421 | Public Sub Write(value As UInteger) |
422 | Call Console.WriteLine(value) |
423 | End Sub |
424 | |
425 | ''' <summary> |
426 | ''' Writes the text representation of the specified 64-bit unsigned integer value to the standard output stream. |
427 | ''' </summary> |
428 | ''' <param name="value">The value to write.</param> |
429 | ''' <remarks></remarks> |
430 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
431 | Public Sub Write(value As ULong) |
432 | Call Console.WriteLine(value) |
433 | End Sub |
434 | |
435 | ''' <summary> |
436 | ''' Writes the current line terminator to the standard output stream. |
437 | ''' </summary> |
438 | ''' <remarks></remarks> |
439 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
440 | Public Sub WriteLine() |
441 | Call Console.WriteLine() |
442 | End Sub |
443 | |
444 | ''' <summary> |
445 | ''' Writes the text representation of the specified Boolean value, followed by the current line terminator, to the standard output stream. |
446 | ''' </summary> |
447 | ''' <param name="value">The value to write.</param> |
448 | ''' <remarks></remarks> |
449 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
450 | Public Sub WriteLine(value As Boolean) |
451 | Call Console.WriteLine(value) |
452 | End Sub |
453 | |
454 | ''' <summary> |
455 | ''' Writes the specified array of Unicode characters, followed by the current line terminator, to the standard output stream. |
456 | ''' </summary> |
457 | ''' <param name="buffer">A Unicode character array.</param> |
458 | ''' <remarks></remarks> |
459 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
460 | Public Sub WriteLine(buffer() As Char) |
461 | Call Console.WriteLine(buffer) |
462 | End Sub |
463 | |
464 | ''' <summary> |
465 | ''' Writes the specified subarray of Unicode characters, followed by the current line terminator, to the standard output stream. |
466 | ''' </summary> |
467 | ''' <param name="buffer">An array of Unicode characters.</param> |
468 | ''' <param name="index">The starting position in buffer.</param> |
469 | ''' <param name="count">The number of characters to write.</param> |
470 | ''' <remarks></remarks> |
471 | ''' <exception cref="System.ArgumentNullException">buffer is null.</exception> |
472 | ''' <exception cref="System.ArgumentOutOfRangeException">index or count is less than zero.</exception> |
473 | ''' <exception cref="System.ArgumentException">index plus count specify a position that is not within buffer.</exception> |
474 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
475 | Public Sub WriteLine(buffer() As Char, index As Integer, count As Integer) |
476 | Call Console.WriteLine(buffer, index, count) |
477 | End Sub |
478 | |
479 | ''' <summary> |
480 | ''' Writes the specified Unicode character, followed by the current line terminator, value to the standard output stream. |
481 | ''' </summary> |
482 | ''' <param name="value">The value to write.</param> |
483 | ''' <remarks></remarks> |
484 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
485 | Public Sub WriteLine(value As Char) |
486 | Call Console.WriteLine(value) |
487 | End Sub |
488 | |
489 | ''' <summary> |
490 | ''' Writes the text representation of the specified System.Decimal value, followed by the current line terminator, to the standard output stream. |
491 | ''' </summary> |
492 | ''' <param name="value">The value to write.</param> |
493 | ''' <remarks></remarks> |
494 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
495 | Public Sub WriteLine(value As Decimal) |
496 | Call Console.WriteLine(value) |
497 | End Sub |
498 | |
499 | ''' <summary> |
500 | ''' Writes the text representation of the specified double-precision floating-point value, followed by the current line terminator, to the standard output stream. |
501 | ''' </summary> |
502 | ''' <param name="value">The value to write.</param> |
503 | ''' <remarks></remarks> |
504 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
505 | Public Sub WriteLine(value As Double) |
506 | Call Console.WriteLine(value) |
507 | End Sub |
508 | |
509 | ''' <summary> |
510 | ''' Writes the text representation of the specified 32-bit signed integer value, followed by the current line terminator, to the standard output stream. |
511 | ''' </summary> |
512 | ''' <param name="value">The value to write.</param> |
513 | ''' <remarks></remarks> |
514 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
515 | Public Sub WriteLine(value As Integer) |
516 | Call Console.WriteLine(value) |
517 | End Sub |
518 | |
519 | ''' <summary> |
520 | ''' Writes the text representation of the specified 64-bit signed integer value, followed by the current line terminator, to the standard output stream. |
521 | ''' </summary> |
522 | ''' <param name="value">The value to write.</param> |
523 | ''' <remarks></remarks> |
524 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
525 | Public Sub WriteLine(value As Long) |
526 | Call Console.WriteLine(value) |
527 | End Sub |
528 | |
529 | ''' <summary> |
530 | ''' Writes the text representation of the specified object, followed by the current line terminator, to the standard output stream. |
531 | ''' </summary> |
532 | ''' <param name="value">The value to write.</param> |
533 | ''' <remarks></remarks> |
534 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
535 | Public Sub WriteLine(value As Object) |
536 | Call Console.WriteLine(value) |
537 | End Sub |
538 | |
539 | ''' <summary> |
540 | ''' Writes the text representation of the specified single-precision floating-point value, followed by the current line terminator, to the standard output stream. |
541 | ''' </summary> |
542 | ''' <param name="value">The value to write.</param> |
543 | ''' <remarks></remarks> |
544 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
545 | Public Sub WriteLine(value As Single) |
546 | Call Console.WriteLine(value) |
547 | End Sub |
548 | |
549 | ''' <summary> |
550 | ''' Writes the specified string value, followed by the current line terminator, to the standard output stream. |
551 | ''' </summary> |
552 | ''' <param name="value">The value to write.</param> |
553 | ''' <remarks></remarks> |
554 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
555 | Public Overridable Sub WriteLine(Optional value As String = "") Implements STDIO__.I_ConsoleDeviceHandle.WriteLine |
556 | Call Console.WriteLine(value) |
557 | End Sub |
558 | |
559 | ''' <summary> |
560 | ''' Writes the text representation of the specified object, followed by the current line terminator, to the standard output stream using the specified format information. |
561 | ''' </summary> |
562 | ''' <param name="format">A composite format string (see Remarks).</param> |
563 | ''' <param name="arg0">An object to write using format.</param> |
564 | ''' <remarks></remarks> |
565 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
566 | ''' <exception cref="System.ArgumentNullException">format is null.</exception> |
567 | ''' <exception cref="System.FormatException">The format specification in format is invalid.</exception> |
568 | Public Sub WriteLine(format As String, arg0 As Object) |
569 | Call Console.WriteLine(format, arg0) |
570 | End Sub |
571 | |
572 | ''' <summary> |
573 | ''' Writes the text representation of the specified objects, followed by the current line terminator, to the standard output stream using the specified format information. |
574 | ''' </summary> |
575 | ''' <param name="format">A composite format string (see Remarks).</param> |
576 | ''' <param name="arg0">The first object to write using format.</param> |
577 | ''' <param name="arg1">The second object to write using format.</param> |
578 | ''' <remarks></remarks> |
579 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
580 | ''' <exception cref="System.ArgumentNullException">format is null.</exception> |
581 | ''' <exception cref="System.FormatException">The format specification in format is invalid.</exception> |
582 | Public Sub WriteLine(format As String, arg0 As Object, arg1 As Object) |
583 | Call Console.WriteLine(format, arg0, arg1) |
584 | End Sub |
585 | |
586 | ''' <summary> |
587 | ''' Writes the text representation of the specified objects, followed by the current line terminator, to the standard output stream using the specified format information. |
588 | ''' </summary> |
589 | ''' <param name="format">A composite format string (see Remarks).</param> |
590 | ''' <param name="arg0">The first object to write using format.</param> |
591 | ''' <param name="arg1">The second object to write using format.</param> |
592 | ''' <param name="arg2">The third object to write using format.</param> |
593 | ''' <remarks></remarks> |
594 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
595 | ''' <exception cref="System.ArgumentNullException">format is null.</exception> |
596 | ''' <exception cref="System.FormatException">The format specification in format is invalid.</exception> |
597 | Public Sub WriteLine(format As String, arg0 As Object, arg1 As Object, arg2 As Object) |
598 | Call Console.WriteLine(format, arg0, arg1, arg2) |
599 | End Sub |
600 | |
601 | ''' <summary> |
602 | ''' Writes the text representation of the specified array of objects, followed by the current line terminator, to the standard output stream using the specified format information. |
603 | ''' </summary> |
604 | ''' <param name="format">A composite format string (see Remarks).</param> |
605 | ''' <param name="arg">An array of objects to write using format.</param> |
606 | ''' <remarks></remarks> |
607 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
608 | ''' <exception cref="System.ArgumentNullException">format or arg is null.</exception> |
609 | ''' <exception cref="System.FormatException">The format specification in format is invalid.</exception> |
610 | Public Sub WriteLine(format As String, ParamArray arg() As Object) |
611 | Call Console.WriteLine(format, arg) |
612 | End Sub |
613 | |
614 | ''' <summary> |
615 | ''' Writes the text representation of the specified 32-bit unsigned integer value, followed by the current line terminator, to the standard output stream. |
616 | ''' </summary> |
617 | ''' <param name="value">The value to write.</param> |
618 | ''' <remarks></remarks> |
619 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
620 | Public Sub WriteLine(value As UInteger) |
621 | Call Console.WriteLine(value) |
622 | End Sub |
623 | |
624 | ''' <summary> |
625 | ''' Writes the text representation of the specified 64-bit unsigned integer value, followed by the current line terminator, to the standard output stream. |
626 | ''' </summary> |
627 | ''' <param name="value">The value to write.</param> |
628 | ''' <remarks></remarks> |
629 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
630 | Public Sub WriteLine(value As ULong) |
631 | Call Console.WriteLine(value) |
632 | End Sub |
633 | |
634 | ''' <summary> |
635 | ''' Acquires the standard error stream. |
636 | ''' </summary> |
637 | ''' <returns>The standard error stream.</returns> |
638 | ''' <remarks></remarks> |
639 | Public Function OpenStandardError() As System.IO.Stream |
640 | Return Console.OpenStandardError |
641 | End Function |
642 | |
643 | ''' <summary> |
644 | ''' Acquires the standard error stream, which is set to a specified buffer size. |
645 | ''' </summary> |
646 | ''' <param name="bufferSize">The internal stream buffer size.</param> |
647 | ''' <returns>The standard error stream.</returns> |
648 | ''' <remarks></remarks> |
649 | ''' <exception cref="System.ArgumentOutOfRangeException">bufferSize is less than or equal to zero.</exception> |
650 | Public Function OpenStandardError(bufferSize As Integer) As System.IO.Stream |
651 | Return Console.OpenStandardError(bufferSize) |
652 | End Function |
653 | |
654 | ''' <summary> |
655 | ''' Acquires the standard input stream. |
656 | ''' </summary> |
657 | ''' <returns>The standard input stream.</returns> |
658 | ''' <remarks></remarks> |
659 | Public Function OpenStandardInput() As System.IO.Stream |
660 | Return Console.OpenStandardInput |
661 | End Function |
662 | |
663 | ''' <summary> |
664 | ''' Acquires the standard input stream, which is set to a specified buffer size. |
665 | ''' </summary> |
666 | ''' <param name="bufferSize">The internal stream buffer size.</param> |
667 | ''' <returns>The standard input stream.</returns> |
668 | ''' <remarks></remarks> |
669 | ''' <exception cref="System.ArgumentOutOfRangeException">bufferSize is less than or equal to zero.</exception> |
670 | Public Function OpenStandardInput(bufferSize As Integer) As System.IO.Stream |
671 | Return Console.OpenStandardInput(bufferSize) |
672 | End Function |
673 | |
674 | ''' <summary> |
675 | ''' Acquires the standard output stream. |
676 | ''' </summary> |
677 | ''' <returns>The standard output stream.</returns> |
678 | ''' <remarks></remarks> |
679 | Public Function OpenStandardOutput() As System.IO.Stream |
680 | Return Console.OpenStandardOutput() |
681 | End Function |
682 | |
683 | ''' <summary> |
684 | ''' Acquires the standard output stream, which is set to a specified buffer size. |
685 | ''' </summary> |
686 | ''' <param name="bufferSize">The internal stream buffer size.</param> |
687 | ''' <returns>The standard output stream.</returns> |
688 | ''' <remarks></remarks> |
689 | ''' <exception cref="System.ArgumentOutOfRangeException">bufferSize is less than or equal to zero.</exception> |
690 | Public Function OpenStandardOutput(bufferSize As Integer) As System.IO.Stream |
691 | Return Console.OpenStandardOutput(bufferSize) |
692 | End Function |
693 | |
694 | ''' <summary> |
695 | ''' Reads the next character from the standard input stream. |
696 | ''' </summary> |
697 | ''' <returns>The next character from the input stream, or negative one (-1) if there are currently no more characters to be read.</returns> |
698 | ''' <remarks></remarks> |
699 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
700 | Public Overridable Function Read() As Integer Implements STDIO__.I_ConsoleDeviceHandle.Read |
701 | Return Console.Read |
702 | End Function |
703 | |
704 | ''' <summary> |
705 | ''' Obtains the next character or function key pressed by the user. The pressed key is displayed in the console window. |
706 | ''' </summary> |
707 | ''' <returns>A System.ConsoleKeyInfo object that describes the System.ConsoleKey constant and Unicode character, if any, that correspond to the pressed console key. The System.ConsoleKeyInfo object also describes, in a bitwise combination of System.ConsoleModifiers values, whether one or more Shift, Alt, or Ctrl modifier keys was pressed simultaneously with the console key.</returns> |
708 | ''' <remarks></remarks> |
709 | ''' <exception cref="System.InvalidOperationException">The System.Console.In property is redirected from some stream other than the console.</exception> |
710 | Public Overridable Function ReadKey() As System.ConsoleKeyInfo |
711 | Return Console.ReadKey |
712 | End Function |
713 | |
714 | ''' <summary> |
715 | ''' Obtains the next character or function key pressed by the user. The pressed key is optionally displayed in the console window. |
716 | ''' </summary> |
717 | ''' <param name="intercept">Determines whether to display the pressed key in the console window. true to not display the pressed key; otherwise, false.</param> |
718 | ''' <returns>A System.ConsoleKeyInfo object that describes the System.ConsoleKey constant and Unicode character, if any, that correspond to the pressed console key. The System.ConsoleKeyInfo object also describes, in a bitwise combination of System.ConsoleModifiers values, whether one or more Shift, Alt, or Ctrl modifier keys was pressed simultaneously with the console key.</returns> |
719 | ''' <remarks></remarks> |
720 | ''' <exception cref="System.InvalidOperationException">The System.Console.In property is redirected from some stream other than the console.</exception> |
721 | Public Overridable Function ReadKey(intercept As Boolean) As System.ConsoleKeyInfo |
722 | Return Console.ReadKey(intercept) |
723 | End Function |
724 | |
725 | ''' <summary> |
726 | ''' Reads the next line of characters from the standard input stream. |
727 | ''' </summary> |
728 | ''' <returns>The next line of characters from the input stream, or null if no more lines are available.</returns> |
729 | ''' <remarks></remarks> |
730 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
731 | ''' <exception cref="System.OutOfMemoryException">There is insufficient memory to allocate a buffer for the returned string.</exception> |
732 | ''' <exception cref="System.ArgumentOutOfRangeException">The number of characters in the next line of characters is greater than System.Int32.MaxValue.</exception> |
733 | Public Overridable Function ReadLine() As String Implements STDIO__.I_ConsoleDeviceHandle.ReadLine |
734 | Return Console.ReadLine |
735 | End Function |
736 | #End Region |
737 | |
738 | #Region "Public Property" |
739 | |
740 | ''' <summary> |
741 | ''' Gets or sets the background color of the console. |
742 | ''' </summary> |
743 | ''' <value></value> |
744 | ''' <returns>A System.ConsoleColor that specifies the background color of the console; that is, the color that appears behind each character. The default is black.</returns> |
745 | ''' <remarks></remarks> |
746 | ''' <exception cref="System.ArgumentException">The color specified in a set operation is not a valid Color.</exception> |
747 | ''' <exception cref="System.Security.SecurityException">The user does not have permission to perform this action.</exception> |
748 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
749 | Public Property BackgroundColor As System.ConsoleColor |
750 | Get |
751 | Return Console.BackgroundColor |
752 | End Get |
753 | Set(value As System.ConsoleColor) |
754 | Console.BackgroundColor = value |
755 | End Set |
756 | End Property |
757 | |
758 | ''' <summary> |
759 | ''' Gets or sets the height of the buffer area. |
760 | ''' </summary> |
761 | ''' <value></value> |
762 | ''' <returns>The current height, in rows, of the buffer area.</returns> |
763 | ''' <remarks></remarks> |
764 | ''' <exception cref="System.ArgumentOutOfRangeException">The value in a set operation is less than or equal to zero.-or- The value in a set operation is greater than or equal to System.Int16.MaxValue.-or- The value in a set operation is less than System.Console.WindowTop + System.Console.WindowHeight.</exception> |
765 | ''' <exception cref="System.Security.SecurityException">The user does not have permission to perform this action.</exception> |
766 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
767 | Public Property BufferHeight As Integer |
768 | Get |
769 | Return Console.BufferHeight |
770 | End Get |
771 | Set(value As Integer) |
772 | Console.BufferHeight = value |
773 | End Set |
774 | End Property |
775 | |
776 | ''' <summary> |
777 | ''' Gets or sets the width of the buffer area. |
778 | ''' </summary> |
779 | ''' <value></value> |
780 | ''' <returns>The current width, in columns, of the buffer area.</returns> |
781 | ''' <remarks></remarks> |
782 | ''' <exception cref="System.ArgumentOutOfRangeException">The value in a set operation is less than or equal to zero.-or- The value in a set operation is greater than or equal to System.Int16.MaxValue.-or- The value in a set operation is less than System.Console.WindowLeft + System.Console.WindowWidth.</exception> |
783 | ''' <exception cref="System.Security.SecurityException">The user does not have permission to perform this action.</exception> |
784 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
785 | Public Property BufferWidth As Integer |
786 | Get |
787 | Return Console.BufferWidth |
788 | End Get |
789 | Set(value As Integer) |
790 | Console.BufferWidth = value |
791 | End Set |
792 | End Property |
793 | |
794 | ''' <summary> |
795 | ''' Gets a value indicating whether the CAPS LOCK keyboard toggle is turned on or turned off. |
796 | ''' </summary> |
797 | ''' <value></value> |
798 | ''' <returns>true if CAPS LOCK is turned on; false if CAPS LOCK is turned off.</returns> |
799 | ''' <remarks></remarks> |
800 | Public ReadOnly Property CapsLock As Boolean |
801 | Get |
802 | Return Console.CapsLock |
803 | End Get |
804 | End Property |
805 | |
806 | ''' <summary> |
807 | ''' Gets or sets the column position of the cursor within the buffer area. |
808 | ''' </summary> |
809 | ''' <value></value> |
810 | ''' <returns>The current position, in columns, of the cursor.</returns> |
811 | ''' <remarks></remarks> |
812 | ''' <exception cref="System.ArgumentOutOfRangeException">The value in a set operation is less than zero.-or- The value in a set operation is greater than or equal to System.Console.BufferWidth.</exception> |
813 | ''' <exception cref="System.Security.SecurityException">The user does not have permission to perform this action.</exception> |
814 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
815 | Public Property CursorLeft As Integer |
816 | Get |
817 | Return Console.CursorLeft |
818 | End Get |
819 | Set(value As Integer) |
820 | Console.CursorLeft = value |
821 | End Set |
822 | End Property |
823 | |
824 | ''' <summary> |
825 | ''' Gets or sets the height of the cursor within a character cell. |
826 | ''' </summary> |
827 | ''' <value></value> |
828 | ''' <returns>The size of the cursor expressed as a percentage of the height of a character cell. The property value ranges from 1 to 100.</returns> |
829 | ''' <remarks></remarks> |
830 | ''' <exception cref="System.ArgumentOutOfRangeException">The value specified in a set operation is less than 1 or greater than 100.</exception> |
831 | ''' <exception cref="System.Security.SecurityException">The user does not have permission to perform this action.</exception> |
832 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
833 | Public Property CursorSize As Integer |
834 | Get |
835 | Return Console.CursorSize |
836 | End Get |
837 | Set(value As Integer) |
838 | Console.CursorSize = value |
839 | End Set |
840 | End Property |
841 | |
842 | ''' <summary> |
843 | ''' Gets or sets the row position of the cursor within the buffer area. |
844 | ''' </summary> |
845 | ''' <value></value> |
846 | ''' <returns>The current position, in rows, of the cursor.</returns> |
847 | ''' <remarks></remarks> |
848 | ''' <exception cref="System.ArgumentOutOfRangeException">The value in a set operation is less than zero.-or- The value in a set operation is greater than or equal to System.Console.BufferHeight.</exception> |
849 | ''' <exception cref="System.Security.SecurityException">The user does not have permission to perform this action.</exception> |
850 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
851 | Public Property CursorTop As Integer |
852 | Get |
853 | Return Console.CursorTop |
854 | End Get |
855 | Set(value As Integer) |
856 | Console.CursorTop = value |
857 | End Set |
858 | End Property |
859 | |
860 | ''' <summary> |
861 | ''' Gets or sets a value indicating whether the cursor is visible. |
862 | ''' </summary> |
863 | ''' <value></value> |
864 | ''' <returns>true if the cursor is visible; otherwise, false.</returns> |
865 | ''' <remarks></remarks> |
866 | ''' <exception cref="System.Security.SecurityException">The user does not have permission to perform this action.</exception> |
867 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
868 | Public Property CursorVisible As Boolean |
869 | Get |
870 | Return Console.CursorVisible |
871 | End Get |
872 | Set(value As Boolean) |
873 | Console.CursorVisible = value |
874 | End Set |
875 | End Property |
876 | |
877 | ''' <summary> |
878 | ''' Gets the standard error output stream. |
879 | ''' </summary> |
880 | ''' <value></value> |
881 | ''' <returns>A System.IO.TextWriter that represents the standard error output stream.</returns> |
882 | ''' <remarks></remarks> |
883 | Public ReadOnly Property [Error] As System.IO.TextWriter |
884 | Get |
885 | Return Console.Error |
886 | End Get |
887 | End Property |
888 | |
889 | ''' <summary> |
890 | ''' Gets or sets the foreground color of the console. |
891 | ''' </summary> |
892 | ''' <value></value> |
893 | ''' <returns>A System.ConsoleColor that specifies the foreground color of the console; that is, the color of each character that is displayed. The default is gray.</returns> |
894 | ''' <remarks></remarks> |
895 | ''' <exception cref="System.ArgumentException">The color specified in a set operation is not a valid Color.</exception> |
896 | ''' <exception cref="System.Security.SecurityException">The user does not have permission to perform this action.</exception> |
897 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
898 | Public Property ForegroundColor As System.ConsoleColor |
899 | Get |
900 | Return Console.ForegroundColor |
901 | End Get |
902 | Set(value As System.ConsoleColor) |
903 | Console.ForegroundColor = value |
904 | End Set |
905 | End Property |
906 | |
907 | ''' <summary> |
908 | ''' Gets the standard input stream. |
909 | ''' </summary> |
910 | ''' <value></value> |
911 | ''' <returns>A System.IO.TextReader that represents the standard input stream.</returns> |
912 | ''' <remarks></remarks> |
913 | Public ReadOnly Property [In] As System.IO.TextReader |
914 | Get |
915 | Return Console.In |
916 | End Get |
917 | End Property |
918 | |
919 | ''' <summary> |
920 | ''' Gets or sets the encoding the console uses to read input. |
921 | ''' </summary> |
922 | ''' <value></value> |
923 | ''' <returns>The encoding used to read console input.</returns> |
924 | ''' <remarks></remarks> |
925 | ''' <exception cref="System.ArgumentNullException">The property value in a set operation is null.</exception> |
926 | ''' <exception cref="System.IO.IOException">An error occurred during the execution of this operation.</exception> |
927 | ''' <exception cref="System.Security.SecurityException">Your application does not have permission to perform this operation.</exception> |
928 | Public Property InputEncoding As System.Text.Encoding |
929 | Get |
930 | Return Console.InputEncoding |
931 | End Get |
932 | Set(value As System.Text.Encoding) |
933 | Console.InputEncoding = value |
934 | End Set |
935 | End Property |
936 | |
937 | #If NET_40 = 0 Then |
938 | |
939 | ''' <summary> |
940 | ''' Gets a value that indicates whether the error output stream has been redirected from the standard error stream. |
941 | ''' </summary> |
942 | ''' <value></value> |
943 | ''' <returns>true if error output is redirected; otherwise, false.</returns> |
944 | ''' <remarks></remarks> |
945 | Public ReadOnly Property IsErrorRedirected As Boolean |
946 | Get |
947 | Return Console.IsErrorRedirected |
948 | End Get |
949 | End Property |
950 | |
951 | ''' <summary> |
952 | ''' Gets a value that indicates whether input has been redirected from the standard input stream. |
953 | ''' </summary> |
954 | ''' <value></value> |
955 | ''' <returns>true if input is redirected; otherwise, false.</returns> |
956 | ''' <remarks></remarks> |
957 | Public ReadOnly Property IsInputRedirected As Boolean |
958 | Get |
959 | Return Console.IsInputRedirected |
960 | End Get |
961 | End Property |
962 | |
963 | ''' <summary> |
964 | ''' Gets a value that indicates whether output has been redirected from the standard output stream. |
965 | ''' </summary> |
966 | ''' <value></value> |
967 | ''' <returns>true if output is redirected; otherwise, false.</returns> |
968 | ''' <remarks></remarks> |
969 | Public ReadOnly Property IsOutputRedirected As Boolean |
970 | Get |
971 | Return Console.IsOutputRedirected |
972 | End Get |
973 | End Property |
974 | #End If |
975 | |
976 | ''' <summary> |
977 | ''' Gets a value indicating whether a key press is available in the input stream. |
978 | ''' </summary> |
979 | ''' <value></value> |
980 | ''' <returns>true if a key press is available; otherwise, false.</returns> |
981 | ''' <remarks></remarks> |
982 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
983 | ''' <exception cref="System.InvalidOperationException">Standard input is redirected to a file instead of the keyboard.</exception> |
984 | Public ReadOnly Property KeyAvailable As Boolean |
985 | Get |
986 | Return Console.KeyAvailable |
987 | End Get |
988 | End Property |
989 | |
990 | ''' <summary> |
991 | ''' Gets the largest possible number of console window rows, based on the current font and screen resolution. |
992 | ''' </summary> |
993 | ''' <value></value> |
994 | ''' <returns>The height of the largest possible console window measured in rows.</returns> |
995 | ''' <remarks></remarks> |
996 | Public ReadOnly Property LargestWindowHeight As Integer |
997 | Get |
998 | Return Console.LargestWindowHeight |
999 | End Get |
1000 | End Property |
1001 | |
1002 | ''' <summary> |
1003 | ''' Gets the largest possible number of console window columns, based on the current font and screen resolution. |
1004 | ''' </summary> |
1005 | ''' <value></value> |
1006 | ''' <returns>The width of the largest possible console window measured in columns.</returns> |
1007 | ''' <remarks></remarks> |
1008 | Public ReadOnly Property LargestWindowWidth As Integer |
1009 | Get |
1010 | Return Console.LargestWindowWidth |
1011 | End Get |
1012 | End Property |
1013 | |
1014 | ''' <summary> |
1015 | ''' Gets a value indicating whether the NUM LOCK keyboard toggle is turned on or turned off. |
1016 | ''' </summary> |
1017 | ''' <value></value> |
1018 | ''' <returns>true if NUM LOCK is turned on; false if NUM LOCK is turned off.</returns> |
1019 | ''' <remarks></remarks> |
1020 | Public ReadOnly Property NumberLock As Boolean |
1021 | Get |
1022 | Return Console.NumberLock |
1023 | End Get |
1024 | End Property |
1025 | |
1026 | ''' <summary> |
1027 | ''' Gets the standard output stream. |
1028 | ''' </summary> |
1029 | ''' <value></value> |
1030 | ''' <returns>A System.IO.TextWriter that represents the standard output stream.</returns> |
1031 | ''' <remarks></remarks> |
1032 | Public ReadOnly Property Out As System.IO.TextWriter |
1033 | Get |
1034 | Return Console.Out |
1035 | End Get |
1036 | End Property |
1037 | |
1038 | ''' <summary> |
1039 | ''' Gets or sets the encoding the console uses to write output. |
1040 | ''' </summary> |
1041 | ''' <value></value> |
1042 | ''' <returns>The encoding used to write console output.</returns> |
1043 | ''' <remarks></remarks> |
1044 | ''' <exception cref="System.ArgumentNullException">The property value in a set operation is null.</exception> |
1045 | ''' <exception cref="System.IO.IOException">An error occurred during the execution of this operation.</exception> |
1046 | ''' <exception cref="System.Security.SecurityException">Your application does not have permission to perform this operation.</exception> |
1047 | Public Property OutputEncoding As System.Text.Encoding |
1048 | Get |
1049 | Return Console.OutputEncoding |
1050 | End Get |
1051 | Set(value As System.Text.Encoding) |
1052 | Console.OutputEncoding = value |
1053 | End Set |
1054 | End Property |
1055 | |
1056 | ''' <summary> |
1057 | ''' Gets or sets the title to display in the console title bar. |
1058 | ''' </summary> |
1059 | ''' <value></value> |
1060 | ''' <returns>The string to be displayed in the title bar of the console. The maximum length of the title string is 24500 characters.</returns> |
1061 | ''' <remarks></remarks> |
1062 | ''' <exception cref="System.InvalidOperationException">In a get operation, the retrieved title is longer than 24500 characters.</exception> |
1063 | ''' <exception cref="System.ArgumentOutOfRangeException">In a set operation, the specified title is longer than 24500 characters.</exception> |
1064 | ''' <exception cref="System.ArgumentNullException">In a set operation, the specified title is null.</exception> |
1065 | ''' <exception cref="System.IO.IOException">An I/O error occurred.</exception> |
1066 | Public Property Title As String |
1067 | Get |
1068 | Return Console.Title |
1069 | End Get |
1070 | Set(value As String) |
1071 | Console.Title = value |
1072 | End Set |
1073 | End Property |
1074 | |
1075 | ''' <summary> |
1076 | ''' Gets or sets a value indicating whether the combination of the System.ConsoleModifiers.Control modifier key and System.ConsoleKey.C console key (Ctrl+C) is treated as ordinary input or as an interruption that is handled by the operating system. |
1077 | ''' </summary> |
1078 | ''' <value></value> |
1079 | ''' <returns>true if Ctrl+C is treated as ordinary input; otherwise, false.</returns> |
1080 | ''' <remarks></remarks> |
1081 | ''' <exception cref="System.IO.IOException">Unable to get or set the input mode of the console input buffer.</exception> |
1082 | Public Property TreatControlCAsInput As Boolean |
1083 | Get |
1084 | Return Console.TreatControlCAsInput |
1085 | End Get |
1086 | Set(value As Boolean) |
1087 | Console.TreatControlCAsInput = value |
1088 | End Set |
1089 | End Property |
1090 | |
1091 | ''' <summary> |
1092 | ''' Gets or sets the height of the console window area. |
1093 | ''' </summary> |
1094 | ''' <value></value> |
1095 | ''' <returns>The height of the console window measured in rows.</returns> |
1096 | ''' <remarks></remarks> |
1097 | ''' <exception cref="System.ArgumentOutOfRangeException">The value of the System.Console.WindowWidth property or the value of the System.Console.WindowHeight property is less than or equal to 0.-or-The value of the System.Console.WindowHeight property plus the value of the System.Console.WindowTop property is greater than or equal to System.Int16.MaxValue.-or-The value of the System.Console.WindowWidth property or the value of the System.Console.WindowHeight property is greater than the largest possible window width or height for the current screen resolution and console font.</exception> |
1098 | ''' <exception cref="System.IO.IOException">Error reading or writing information.</exception> |
1099 | Public Property WindowHeight As Integer |
1100 | Get |
1101 | Return Console.WindowHeight |
1102 | End Get |
1103 | Set(value As Integer) |
1104 | Console.WindowHeight = value |
1105 | End Set |
1106 | End Property |
1107 | |
1108 | ''' <summary> |
1109 | ''' Gets or sets the leftmost position of the console window area relative to the screen buffer. |
1110 | ''' </summary> |
1111 | ''' <value></value> |
1112 | ''' <returns>The leftmost console window position measured in columns.</returns> |
1113 | ''' <remarks></remarks> |
1114 | ''' <exception cref="System.ArgumentOutOfRangeException">In a set operation, the value to be assigned is less than zero.-or-As a result of the assignment, System.Console.WindowLeft plus System.Console.WindowWidth would exceed System.Console.BufferWidth.</exception> |
1115 | ''' <exception cref="System.IO.IOException">Error reading or writing information.</exception> |
1116 | Public Property WindowLeft As Integer |
1117 | Get |
1118 | Return Console.WindowLeft |
1119 | End Get |
1120 | Set(value As Integer) |
1121 | Console.WindowLeft = value |
1122 | End Set |
1123 | End Property |
1124 | |
1125 | ''' <summary> |
1126 | ''' Gets or sets the top position of the console window area relative to the screen buffer. |
1127 | ''' </summary> |
1128 | ''' <value></value> |
1129 | ''' <returns>The uppermost console window position measured in rows.</returns> |
1130 | ''' <remarks></remarks> |
1131 | ''' <exception cref="System.ArgumentOutOfRangeException">In a set operation, the value to be assigned is less than zero.-or-As a result of the assignment, System.Console.WindowTop plus System.Console.WindowHeight would exceed System.Console.BufferHeight.</exception> |
1132 | ''' <exception cref="System.IO.IOException">Error reading or writing information.</exception> |
1133 | Public Property WindowTop As Integer |
1134 | Get |
1135 | Return Console.WindowTop |
1136 | End Get |
1137 | Set(value As Integer) |
1138 | Console.WindowTop = value |
1139 | End Set |
1140 | End Property |
1141 | |
1142 | ''' <summary> |
1143 | ''' Gets or sets the width of the console window. |
1144 | ''' </summary> |
1145 | ''' <value></value> |
1146 | ''' <returns>The width of the console window measured in columns.</returns> |
1147 | ''' <remarks></remarks> |
1148 | ''' <exception cref="System.ArgumentOutOfRangeException">The value of the System.Console.WindowWidth property or the value of the System.Console.WindowHeight property is less than or equal to 0.-or-The value of the System.Console.WindowHeight property plus the value of the System.Console.WindowTop property is greater than or equal to System.Int16.MaxValue.-or-The value of the System.Console.WindowWidth property or the value of the System.Console.WindowHeight property is greater than the largest possible window width or height for the current screen resolution and console font.</exception> |
1149 | ''' <exception cref="System.IO.IOException">Error reading or writing information.</exception> |
1150 | Public Property WindowWidth As Integer |
1151 | Get |
1152 | Return Console.WindowWidth |
1153 | End Get |
1154 | Set(value As Integer) |
1155 | Console.WindowWidth = value |
1156 | End Set |
1157 | End Property |
1158 | |
1159 | #End Region |
1160 | |
1161 | ''' <summary> |
1162 | ''' Occurs when the System.ConsoleModifiers.Control modifier key (Ctrl) and either the System.ConsoleKey.C console key (C) or the Break key are pressed simultaneously (Ctrl+C or Ctrl+Break). |
1163 | ''' </summary> |
1164 | ''' <param name="sender"></param> |
1165 | ''' <param name="e"></param> |
1166 | ''' <remarks></remarks> |
1167 | Public Event CancelKeyPress(sender As Object, e As System.ConsoleCancelEventArgs) |
1168 | #End Region |
1169 | End Class |
1170 | End Namespace |