Commit 5fa0fc6832eab2b0206b3bf9e4199e040de224ed

Authored by Perry Werneck
1 parent e557ca10
Exists in master

Atualizando documentação.

Showing 1 changed file with 119 additions and 2 deletions   Show diff stats
src/tn3270-sharp/tn3270-sharp.cs
@@ -177,7 +177,7 @@ namespace tn3270 { @@ -177,7 +177,7 @@ namespace tn3270 {
177 } 177 }
178 178
179 /// <summary> 179 /// <summary>
180 - /// Get connection statue 180 + /// Get connection state
181 /// </summary> 181 /// </summary>
182 /// 182 ///
183 /// <returns> 183 /// <returns>
@@ -196,54 +196,171 @@ namespace tn3270 { @@ -196,54 +196,171 @@ namespace tn3270 {
196 return tn3270_disconnect(hSession); 196 return tn3270_disconnect(hSession);
197 } 197 }
198 198
  199 + /// <summary>
  200 + /// Wait for network activity
  201 + /// </summary>
  202 + ///
  203 + /// <param name="seconds">Seconds to wait</param>
  204 + ///
  205 + /// <returns>
  206 + ///
  207 + /// </returns>
  208 + ///
199 public int WaitForReady(int seconds) { 209 public int WaitForReady(int seconds) {
200 return tn3270_wait_for_ready(hSession, seconds); 210 return tn3270_wait_for_ready(hSession, seconds);
201 } 211 }
202 212
  213 + /// <summary>
  214 + /// "Sleep" keeping the network activity.
  215 + /// </summary>
  216 + ///
  217 + /// <param name="seconds">Number of seconds to wait</param>
  218 + ///
  219 + /// <returns>
  220 + ///
  221 + /// </returns>
  222 + ///
203 public int Wait(int seconds) { 223 public int Wait(int seconds) {
204 return tn3270_wait(hSession, seconds); 224 return tn3270_wait(hSession, seconds);
205 } 225 }
206 226
  227 + /// <summary>
  228 + /// Get contents at address
  229 + /// </summary>
  230 + ///
  231 + /// <param name="addr">Address of text in the screen buffer</param>
  232 + /// <param name="strlen">Number of characters to get</param>
  233 + ///
  234 + /// <returns>
  235 + /// Contents from terminal screen.
  236 + /// </returns>
  237 + ///
207 public string GetString(int addr, int strlen) { 238 public string GetString(int addr, int strlen) {
208 StringBuilder str = new StringBuilder(strlen+1); 239 StringBuilder str = new StringBuilder(strlen+1);
209 tn3270_get_string(hSession, addr, str, strlen); 240 tn3270_get_string(hSession, addr, str, strlen);
210 return str.ToString(0,strlen); 241 return str.ToString(0,strlen);
211 } 242 }
212 243
  244 + /// <summary>
  245 + /// Get contents at position.
  246 + /// </summary>
  247 + ///
  248 + /// <param name="row">Start row</param>
  249 + /// <param name="col">Start col</param>
  250 + /// <param name="strlen">Number of characters to get</param>
  251 + ///
  252 + /// <returns>
  253 + /// Contents from terminal screen.
  254 + /// </returns>
  255 + ///
213 public string GetStringAt(int row, int col, int strlen) { 256 public string GetStringAt(int row, int col, int strlen) {
214 StringBuilder str = new StringBuilder(strlen+1); 257 StringBuilder str = new StringBuilder(strlen+1);
215 tn3270_get_string_at(hSession, row, col, str, strlen); 258 tn3270_get_string_at(hSession, row, col, str, strlen);
216 return str.ToString(0,strlen); 259 return str.ToString(0,strlen);
217 } 260 }
218 261
  262 + /// <summary>
  263 + /// Set contents at position
  264 + /// </summary>
  265 + ///
  266 + /// <param name="row">Start row</param>
  267 + /// <param name="col">Start col</param>
  268 + /// <param name="str">Text to set</param>
  269 + ///
219 public void SetStringAg(int row, int col, string str) { 270 public void SetStringAg(int row, int col, string str) {
220 tn3270_set_string_at(hSession, row, col, str); 271 tn3270_set_string_at(hSession, row, col, str);
221 } 272 }
222 273
  274 + /// <summary>
  275 + /// Wait for text at position.
  276 + /// </summary>
  277 + ///
  278 + /// <param name="row">Start row</param>
  279 + /// <param name="col">Start col</param>
  280 + /// <param name="str">Text to wait</param>
  281 + /// <param name="timeout">Seconds to wait</param>
  282 + ///
  283 + /// <returns>
  284 + ///
  285 + /// </returns>
  286 + ///
223 public int WaitForStringAt(int row, int col, string str, int timeout) { 287 public int WaitForStringAt(int row, int col, string str, int timeout) {
224 return tn3270_wait_for_string_at(hSession, row, col, str, timeout); 288 return tn3270_wait_for_string_at(hSession, row, col, str, timeout);
225 } 289 }
226 290
  291 + /// <summary>
  292 + /// Compare contents at position
  293 + /// </summary>
  294 + ///
  295 + /// <param name="row">Start row</param>
  296 + /// <param name="col">Start col</param>
  297 + /// <param name="str">Text to compare</param>
  298 + ///
  299 + /// <returns>
  300 + /// Result (0 = The strings are the same).
  301 + /// </returns>
  302 + ///
227 public int CmpStringAt(int row, int col, string str) { 303 public int CmpStringAt(int row, int col, string str) {
228 return tn3270_cmp_string_at(hSession, row, col, str); 304 return tn3270_cmp_string_at(hSession, row, col, str);
229 } 305 }
230 306
  307 + /// <summary>
  308 + /// Set cursor position.
  309 + /// </summary>
  310 + ///
  311 + /// <param name="row">New cursor row</param>
  312 + /// <param name="col">New cursor column</param>
  313 + ///
231 public void SetCursorPosition(int row, int col) { 314 public void SetCursorPosition(int row, int col) {
232 tn3270_set_cursor_position(hSession, row, col); 315 tn3270_set_cursor_position(hSession, row, col);
233 } 316 }
234 317
235 - public void SetCursorAddr(int addr) { 318 + /// <summary>
  319 + /// Set cursor position based on address.
  320 + /// </summary>
  321 + ///
  322 + /// <param name="addr">Address of the new cursor position</param>
  323 + ///
  324 + public void SetCursorPosition(int addr) {
236 tn3270_set_cursor_addr(hSession, addr); 325 tn3270_set_cursor_addr(hSession, addr);
237 } 326 }
238 327
  328 + /// <summary>
  329 + /// Send "Enter" key
  330 + /// </summary>
  331 + ///
  332 + /// <returns>
  333 + ///
  334 + /// </returns>
  335 + ///
239 public int Enter() { 336 public int Enter() {
240 return tn3270_enter(hSession); 337 return tn3270_enter(hSession);
241 } 338 }
242 339
  340 + /// <summary>
  341 + /// Send "PF" key
  342 + /// </summary>
  343 + ///
  344 + /// <param name="key">Key identifier 1=PF1, 2=PF2, ...</param>
  345 + ///
  346 + /// <returns>
  347 + ///
  348 + /// </returns>
  349 + ///
243 public int PfKey(int key) { 350 public int PfKey(int key) {
244 return tn3270_pfkey(hSession, key); 351 return tn3270_pfkey(hSession, key);
245 } 352 }
246 353
  354 + /// <summary>
  355 + /// Send "PA" key
  356 + /// </summary>
  357 + ///
  358 + /// <param name="key">Key identifier 1=PA1, 2=PA2, ...</param>
  359 + ///
  360 + /// <returns>
  361 + ///
  362 + /// </returns>
  363 + ///
247 public int PaKey(int key) { 364 public int PaKey(int key) {
248 return tn3270_pakey(hSession, key); 365 return tn3270_pakey(hSession, key);
249 } 366 }