@@ -29,30 +29,136 @@ static ConsoleProxy()
29
29
s_consoleProxy = new UnixConsoleOperations ( ) ;
30
30
}
31
31
32
- public static Task < ConsoleKeyInfo > ReadKeyAsync ( CancellationToken cancellationToken ) =>
33
- s_consoleProxy . ReadKeyAsync ( cancellationToken ) ;
32
+ /// <summary>
33
+ /// Obtains the next character or function key pressed by the user asynchronously.
34
+ /// Does not block when other console API's are called.
35
+ /// </summary>
36
+ /// <param name="intercept">
37
+ /// Determines whether to display the pressed key in the console window. <see langword="true" />
38
+ /// to not display the pressed key; otherwise, <see langword="false" />.
39
+ /// </param>
40
+ /// <param name="cancellationToken">The CancellationToken to observe.</param>
41
+ /// <returns>
42
+ /// An object that describes the <see cref="ConsoleKey" /> constant and Unicode character, if any,
43
+ /// that correspond to the pressed console key. The <see cref="ConsoleKeyInfo" /> object also
44
+ /// describes, in a bitwise combination of <see cref="ConsoleModifiers" /> values, whether
45
+ /// one or more Shift, Alt, or Ctrl modifier keys was pressed simultaneously with the console key.
46
+ /// </returns>
47
+ public static ConsoleKeyInfo ReadKey ( bool intercept , CancellationToken cancellationToken ) =>
48
+ s_consoleProxy . ReadKey ( intercept , cancellationToken ) ;
34
49
50
+ /// <summary>
51
+ /// Obtains the next character or function key pressed by the user asynchronously.
52
+ /// Does not block when other console API's are called.
53
+ /// </summary>
54
+ /// <param name="intercept">
55
+ /// Determines whether to display the pressed key in the console window. <see langword="true" />
56
+ /// to not display the pressed key; otherwise, <see langword="false" />.
57
+ /// </param>
58
+ /// <param name="cancellationToken">The CancellationToken to observe.</param>
59
+ /// <returns>
60
+ /// A task that will complete with a result of the key pressed by the user.
61
+ /// </returns>
62
+ public static Task < ConsoleKeyInfo > ReadKeyAsync ( bool intercept , CancellationToken cancellationToken ) =>
63
+ s_consoleProxy . ReadKeyAsync ( intercept , cancellationToken ) ;
64
+
65
+ /// <summary>
66
+ /// Obtains the horizontal position of the console cursor. Use this method
67
+ /// instead of <see cref="System.Console.CursorLeft" /> to avoid triggering
68
+ /// pending calls to <see cref="IConsoleOperations.ReadKeyAsync(bool, CancellationToken)" />
69
+ /// on Unix platforms.
70
+ /// </summary>
71
+ /// <returns>The horizontal position of the console cursor.</returns>
35
72
public static int GetCursorLeft ( ) =>
36
73
s_consoleProxy . GetCursorLeft ( ) ;
37
74
75
+ /// <summary>
76
+ /// Obtains the horizontal position of the console cursor. Use this method
77
+ /// instead of <see cref="System.Console.CursorLeft" /> to avoid triggering
78
+ /// pending calls to <see cref="IConsoleOperations.ReadKeyAsync(bool, CancellationToken)" />
79
+ /// on Unix platforms.
80
+ /// </summary>
81
+ /// <param name="cancellationToken">The <see cref="CancellationToken" /> to observe.</param>
82
+ /// <returns>The horizontal position of the console cursor.</returns>
38
83
public static int GetCursorLeft ( CancellationToken cancellationToken ) =>
39
84
s_consoleProxy . GetCursorLeft ( cancellationToken ) ;
40
85
86
+ /// <summary>
87
+ /// Obtains the horizontal position of the console cursor. Use this method
88
+ /// instead of <see cref="System.Console.CursorLeft" /> to avoid triggering
89
+ /// pending calls to <see cref="IConsoleOperations.ReadKeyAsync(bool, CancellationToken)" />
90
+ /// on Unix platforms.
91
+ /// </summary>
92
+ /// <returns>
93
+ /// A <see cref="Task{T}" /> representing the asynchronous operation. The
94
+ /// <see cref="Task{T}.Result" /> property will return the horizontal position
95
+ /// of the console cursor.
96
+ /// </returns>
41
97
public static Task < int > GetCursorLeftAsync ( ) =>
42
98
s_consoleProxy . GetCursorLeftAsync ( ) ;
43
99
100
+ /// <summary>
101
+ /// Obtains the horizontal position of the console cursor. Use this method
102
+ /// instead of <see cref="System.Console.CursorLeft" /> to avoid triggering
103
+ /// pending calls to <see cref="IConsoleOperations.ReadKeyAsync(bool, CancellationToken)" />
104
+ /// on Unix platforms.
105
+ /// </summary>
106
+ /// <param name="cancellationToken">The <see cref="CancellationToken" /> to observe.</param>
107
+ /// <returns>
108
+ /// A <see cref="Task{T}" /> representing the asynchronous operation. The
109
+ /// <see cref="Task{T}.Result" /> property will return the horizontal position
110
+ /// of the console cursor.
111
+ /// </returns>
44
112
public static Task < int > GetCursorLeftAsync ( CancellationToken cancellationToken ) =>
45
113
s_consoleProxy . GetCursorLeftAsync ( cancellationToken ) ;
46
114
115
+ /// <summary>
116
+ /// Obtains the vertical position of the console cursor. Use this method
117
+ /// instead of <see cref="System.Console.CursorTop" /> to avoid triggering
118
+ /// pending calls to <see cref="IConsoleOperations.ReadKeyAsync(bool, CancellationToken)" />
119
+ /// on Unix platforms.
120
+ /// </summary>
121
+ /// <returns>The vertical position of the console cursor.</returns>
47
122
public static int GetCursorTop ( ) =>
48
123
s_consoleProxy . GetCursorTop ( ) ;
49
124
125
+ /// <summary>
126
+ /// Obtains the vertical position of the console cursor. Use this method
127
+ /// instead of <see cref="System.Console.CursorTop" /> to avoid triggering
128
+ /// pending calls to <see cref="IConsoleOperations.ReadKeyAsync(bool, CancellationToken)" />
129
+ /// on Unix platforms.
130
+ /// </summary>
131
+ /// <param name="cancellationToken">The <see cref="CancellationToken" /> to observe.</param>
132
+ /// <returns>The vertical position of the console cursor.</returns>
50
133
public static int GetCursorTop ( CancellationToken cancellationToken ) =>
51
134
s_consoleProxy . GetCursorTop ( cancellationToken ) ;
52
135
136
+ /// <summary>
137
+ /// Obtains the vertical position of the console cursor. Use this method
138
+ /// instead of <see cref="System.Console.CursorTop" /> to avoid triggering
139
+ /// pending calls to <see cref="IConsoleOperations.ReadKeyAsync(bool, CancellationToken)" />
140
+ /// on Unix platforms.
141
+ /// </summary>
142
+ /// <returns>
143
+ /// A <see cref="Task{T}" /> representing the asynchronous operation. The
144
+ /// <see cref="Task{T}.Result" /> property will return the vertical position
145
+ /// of the console cursor.
146
+ /// </returns>
53
147
public static Task < int > GetCursorTopAsync ( ) =>
54
148
s_consoleProxy . GetCursorTopAsync ( ) ;
55
149
150
+ /// <summary>
151
+ /// Obtains the vertical position of the console cursor. Use this method
152
+ /// instead of <see cref="System.Console.CursorTop" /> to avoid triggering
153
+ /// pending calls to <see cref="IConsoleOperations.ReadKeyAsync(bool, CancellationToken)" />
154
+ /// on Unix platforms.
155
+ /// </summary>
156
+ /// <param name="cancellationToken">The <see cref="CancellationToken" /> to observe.</param>
157
+ /// <returns>
158
+ /// A <see cref="Task{T}" /> representing the asynchronous operation. The
159
+ /// <see cref="Task{T}.Result" /> property will return the vertical position
160
+ /// of the console cursor.
161
+ /// </returns>
56
162
public static Task < int > GetCursorTopAsync ( CancellationToken cancellationToken ) =>
57
163
s_consoleProxy . GetCursorTopAsync ( cancellationToken ) ;
58
164
0 commit comments