FakeConsole.cs 52 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017
  1. //
  2. // FakeConsole.cs: A fake .NET Windows Console API implementation for unit tests.
  3. //
  4. using System;
  5. using System.Collections.Generic;
  6. using System.IO;
  7. using System.Text;
  8. namespace Terminal.Gui {
  9. #pragma warning disable RCS1138 // Add summary to documentation comment.
  10. /// <summary>
  11. ///
  12. /// </summary>
  13. public static class FakeConsole {
  14. #pragma warning restore RCS1138 // Add summary to documentation comment.
  15. //
  16. // Summary:
  17. // Gets or sets the width of the console window.
  18. //
  19. // Returns:
  20. // The width of the console window measured in columns.
  21. //
  22. // Exceptions:
  23. // T:System.ArgumentOutOfRangeException:
  24. // The value of the System.Console.WindowWidth property or the value of the System.Console.WindowHeight
  25. // property is less than or equal to 0.-or-The value of the System.Console.WindowHeight
  26. // property plus the value of the System.Console.WindowTop property is greater than
  27. // or equal to System.Int16.MaxValue.-or-The value of the System.Console.WindowWidth
  28. // property or the value of the System.Console.WindowHeight property is greater
  29. // than the largest possible window width or height for the current screen resolution
  30. // and console font.
  31. //
  32. // T:System.IO.IOException:
  33. // Error reading or writing information.
  34. #pragma warning disable RCS1138 // Add summary to documentation comment.
  35. /// <summary>
  36. /// Specifies the initial console width.
  37. /// </summary>
  38. public const int WIDTH = 80;
  39. /// <summary>
  40. /// Specifies the initial console height.
  41. /// </summary>
  42. public const int HEIGHT = 25;
  43. /// <summary>
  44. ///
  45. /// </summary>
  46. public static int WindowWidth { get; set; } = WIDTH;
  47. //
  48. // Summary:
  49. // Gets a value that indicates whether output has been redirected from the standard
  50. // output stream.
  51. //
  52. // Returns:
  53. // true if output is redirected; otherwise, false.
  54. /// <summary>
  55. ///
  56. /// </summary>
  57. public static bool IsOutputRedirected { get; }
  58. //
  59. // Summary:
  60. // Gets a value that indicates whether the error output stream has been redirected
  61. // from the standard error stream.
  62. //
  63. // Returns:
  64. // true if error output is redirected; otherwise, false.
  65. /// <summary>
  66. ///
  67. /// </summary>
  68. public static bool IsErrorRedirected { get; }
  69. //
  70. // Summary:
  71. // Gets the standard input stream.
  72. //
  73. // Returns:
  74. // A System.IO.TextReader that represents the standard input stream.
  75. /// <summary>
  76. ///
  77. /// </summary>
  78. public static TextReader In { get; }
  79. //
  80. // Summary:
  81. // Gets the standard output stream.
  82. //
  83. // Returns:
  84. // A System.IO.TextWriter that represents the standard output stream.
  85. /// <summary>
  86. ///
  87. /// </summary>
  88. public static TextWriter Out { get; }
  89. //
  90. // Summary:
  91. // Gets the standard error output stream.
  92. //
  93. // Returns:
  94. // A System.IO.TextWriter that represents the standard error output stream.
  95. /// <summary>
  96. ///
  97. /// </summary>
  98. public static TextWriter Error { get; }
  99. //
  100. // Summary:
  101. // Gets or sets the encoding the console uses to read input.
  102. //
  103. // Returns:
  104. // The encoding used to read console input.
  105. //
  106. // Exceptions:
  107. // T:System.ArgumentNullException:
  108. // The property value in a set operation is null.
  109. //
  110. // T:System.IO.IOException:
  111. // An error occurred during the execution of this operation.
  112. //
  113. // T:System.Security.SecurityException:
  114. // Your application does not have permission to perform this operation.
  115. /// <summary>
  116. ///
  117. /// </summary>
  118. public static Encoding InputEncoding { get; set; }
  119. //
  120. // Summary:
  121. // Gets or sets the encoding the console uses to write output.
  122. //
  123. // Returns:
  124. // The encoding used to write console output.
  125. //
  126. // Exceptions:
  127. // T:System.ArgumentNullException:
  128. // The property value in a set operation is null.
  129. //
  130. // T:System.IO.IOException:
  131. // An error occurred during the execution of this operation.
  132. //
  133. // T:System.Security.SecurityException:
  134. // Your application does not have permission to perform this operation.
  135. /// <summary>
  136. ///
  137. /// </summary>
  138. public static Encoding OutputEncoding { get; set; }
  139. //
  140. // Summary:
  141. // Gets or sets the background color of the console.
  142. //
  143. // Returns:
  144. // A value that specifies the background color of the console; that is, the color
  145. // that appears behind each character. The default is black.
  146. //
  147. // Exceptions:
  148. // T:System.ArgumentException:
  149. // The color specified in a set operation is not a valid member of System.ConsoleColor.
  150. //
  151. // T:System.Security.SecurityException:
  152. // The user does not have permission to perform this action.
  153. //
  154. // T:System.IO.IOException:
  155. // An I/O error occurred.
  156. static ConsoleColor _defaultBackgroundColor = ConsoleColor.Black;
  157. /// <summary>
  158. ///
  159. /// </summary>
  160. public static ConsoleColor BackgroundColor { get; set; } = _defaultBackgroundColor;
  161. //
  162. // Summary:
  163. // Gets or sets the foreground color of the console.
  164. //
  165. // Returns:
  166. // A System.ConsoleColor that specifies the foreground color of the console; that
  167. // is, the color of each character that is displayed. The default is gray.
  168. //
  169. // Exceptions:
  170. // T:System.ArgumentException:
  171. // The color specified in a set operation is not a valid member of System.ConsoleColor.
  172. //
  173. // T:System.Security.SecurityException:
  174. // The user does not have permission to perform this action.
  175. //
  176. // T:System.IO.IOException:
  177. // An I/O error occurred.
  178. static ConsoleColor _defaultForegroundColor = ConsoleColor.Gray;
  179. /// <summary>
  180. ///
  181. /// </summary>
  182. public static ConsoleColor ForegroundColor { get; set; } = _defaultForegroundColor;
  183. //
  184. // Summary:
  185. // Gets or sets the height of the buffer area.
  186. //
  187. // Returns:
  188. // The current height, in rows, of the buffer area.
  189. //
  190. // Exceptions:
  191. // T:System.ArgumentOutOfRangeException:
  192. // The value in a set operation is less than or equal to zero.-or- The value in
  193. // a set operation is greater than or equal to System.Int16.MaxValue.-or- The value
  194. // in a set operation is less than System.Console.WindowTop + System.Console.WindowHeight.
  195. //
  196. // T:System.Security.SecurityException:
  197. // The user does not have permission to perform this action.
  198. //
  199. // T:System.IO.IOException:
  200. // An I/O error occurred.
  201. /// <summary>
  202. ///
  203. /// </summary>
  204. public static int BufferHeight { get; set; } = HEIGHT;
  205. //
  206. // Summary:
  207. // Gets or sets the width of the buffer area.
  208. //
  209. // Returns:
  210. // The current width, in columns, of the buffer area.
  211. //
  212. // Exceptions:
  213. // T:System.ArgumentOutOfRangeException:
  214. // The value in a set operation is less than or equal to zero.-or- The value in
  215. // a set operation is greater than or equal to System.Int16.MaxValue.-or- The value
  216. // in a set operation is less than System.Console.WindowLeft + System.Console.WindowWidth.
  217. //
  218. // T:System.Security.SecurityException:
  219. // The user does not have permission to perform this action.
  220. //
  221. // T:System.IO.IOException:
  222. // An I/O error occurred.
  223. /// <summary>
  224. ///
  225. /// </summary>
  226. public static int BufferWidth { get; set; } = WIDTH;
  227. //
  228. // Summary:
  229. // Gets or sets the height of the console window area.
  230. //
  231. // Returns:
  232. // The height of the console window measured in rows.
  233. //
  234. // Exceptions:
  235. // T:System.ArgumentOutOfRangeException:
  236. // The value of the System.Console.WindowWidth property or the value of the System.Console.WindowHeight
  237. // property is less than or equal to 0.-or-The value of the System.Console.WindowHeight
  238. // property plus the value of the System.Console.WindowTop property is greater than
  239. // or equal to System.Int16.MaxValue.-or-The value of the System.Console.WindowWidth
  240. // property or the value of the System.Console.WindowHeight property is greater
  241. // than the largest possible window width or height for the current screen resolution
  242. // and console font.
  243. //
  244. // T:System.IO.IOException:
  245. // Error reading or writing information.
  246. /// <summary>
  247. ///
  248. /// </summary>
  249. public static int WindowHeight { get; set; } = HEIGHT;
  250. //
  251. // Summary:
  252. // Gets or sets a value indicating whether the combination of the System.ConsoleModifiers.Control
  253. // modifier key and System.ConsoleKey.C console key (Ctrl+C) is treated as ordinary
  254. // input or as an interruption that is handled by the operating system.
  255. //
  256. // Returns:
  257. // true if Ctrl+C is treated as ordinary input; otherwise, false.
  258. //
  259. // Exceptions:
  260. // T:System.IO.IOException:
  261. // Unable to get or set the input mode of the console input buffer.
  262. /// <summary>
  263. ///
  264. /// </summary>
  265. public static bool TreatControlCAsInput { get; set; }
  266. //
  267. // Summary:
  268. // Gets the largest possible number of console window columns, based on the current
  269. // font and screen resolution.
  270. //
  271. // Returns:
  272. // The width of the largest possible console window measured in columns.
  273. /// <summary>
  274. ///
  275. /// </summary>
  276. public static int LargestWindowWidth { get; }
  277. //
  278. // Summary:
  279. // Gets the largest possible number of console window rows, based on the current
  280. // font and screen resolution.
  281. //
  282. // Returns:
  283. // The height of the largest possible console window measured in rows.
  284. /// <summary>
  285. ///
  286. /// </summary>
  287. public static int LargestWindowHeight { get; }
  288. //
  289. // Summary:
  290. // Gets or sets the leftmost position of the console window area relative to the
  291. // screen buffer.
  292. //
  293. // Returns:
  294. // The leftmost console window position measured in columns.
  295. //
  296. // Exceptions:
  297. // T:System.ArgumentOutOfRangeException:
  298. // In a set operation, the value to be assigned is less than zero.-or-As a result
  299. // of the assignment, System.Console.WindowLeft plus System.Console.WindowWidth
  300. // would exceed System.Console.BufferWidth.
  301. //
  302. // T:System.IO.IOException:
  303. // Error reading or writing information.
  304. /// <summary>
  305. ///
  306. /// </summary>
  307. public static int WindowLeft { get; set; }
  308. //
  309. // Summary:
  310. // Gets or sets the top position of the console window area relative to the screen
  311. // buffer.
  312. //
  313. // Returns:
  314. // The uppermost console window position measured in rows.
  315. //
  316. // Exceptions:
  317. // T:System.ArgumentOutOfRangeException:
  318. // In a set operation, the value to be assigned is less than zero.-or-As a result
  319. // of the assignment, System.Console.WindowTop plus System.Console.WindowHeight
  320. // would exceed System.Console.BufferHeight.
  321. //
  322. // T:System.IO.IOException:
  323. // Error reading or writing information.
  324. /// <summary>
  325. ///
  326. /// </summary>
  327. public static int WindowTop { get; set; }
  328. //
  329. // Summary:
  330. // Gets or sets the column position of the cursor within the buffer area.
  331. //
  332. // Returns:
  333. // The current position, in columns, of the cursor.
  334. //
  335. // Exceptions:
  336. // T:System.ArgumentOutOfRangeException:
  337. // The value in a set operation is less than zero.-or- The value in a set operation
  338. // is greater than or equal to System.Console.BufferWidth.
  339. //
  340. // T:System.Security.SecurityException:
  341. // The user does not have permission to perform this action.
  342. //
  343. // T:System.IO.IOException:
  344. // An I/O error occurred.
  345. /// <summary>
  346. ///
  347. /// </summary>
  348. public static int CursorLeft { get; set; }
  349. //
  350. // Summary:
  351. // Gets or sets the row position of the cursor within the buffer area.
  352. //
  353. // Returns:
  354. // The current position, in rows, of the cursor.
  355. //
  356. // Exceptions:
  357. // T:System.ArgumentOutOfRangeException:
  358. // The value in a set operation is less than zero.-or- The value in a set operation
  359. // is greater than or equal to System.Console.BufferHeight.
  360. //
  361. // T:System.Security.SecurityException:
  362. // The user does not have permission to perform this action.
  363. //
  364. // T:System.IO.IOException:
  365. // An I/O error occurred.
  366. /// <summary>
  367. ///
  368. /// </summary>
  369. public static int CursorTop { get; set; }
  370. //
  371. // Summary:
  372. // Gets or sets the height of the cursor within a character cell.
  373. //
  374. // Returns:
  375. // The size of the cursor expressed as a percentage of the height of a character
  376. // cell. The property value ranges from 1 to 100.
  377. //
  378. // Exceptions:
  379. // T:System.ArgumentOutOfRangeException:
  380. // The value specified in a set operation is less than 1 or greater than 100.
  381. //
  382. // T:System.Security.SecurityException:
  383. // The user does not have permission to perform this action.
  384. //
  385. // T:System.IO.IOException:
  386. // An I/O error occurred.
  387. /// <summary>
  388. ///
  389. /// </summary>
  390. public static int CursorSize { get; set; }
  391. //
  392. // Summary:
  393. // Gets or sets a value indicating whether the cursor is visible.
  394. //
  395. // Returns:
  396. // true if the cursor is visible; otherwise, false.
  397. //
  398. // Exceptions:
  399. // T:System.Security.SecurityException:
  400. // The user does not have permission to perform this action.
  401. //
  402. // T:System.IO.IOException:
  403. // An I/O error occurred.
  404. /// <summary>
  405. ///
  406. /// </summary>
  407. public static bool CursorVisible { get; set; }
  408. //
  409. // Summary:
  410. // Gets or sets the title to display in the console title bar.
  411. //
  412. // Returns:
  413. // The string to be displayed in the title bar of the console. The maximum length
  414. // of the title string is 24500 characters.
  415. //
  416. // Exceptions:
  417. // T:System.InvalidOperationException:
  418. // In a get operation, the retrieved title is longer than 24500 characters.
  419. //
  420. // T:System.ArgumentOutOfRangeException:
  421. // In a set operation, the specified title is longer than 24500 characters.
  422. //
  423. // T:System.ArgumentNullException:
  424. // In a set operation, the specified title is null.
  425. //
  426. // T:System.IO.IOException:
  427. // An I/O error occurred.
  428. /// <summary>
  429. ///
  430. /// </summary>
  431. public static string Title { get; set; }
  432. //
  433. // Summary:
  434. // Gets a value indicating whether a key press is available in the input stream.
  435. //
  436. // Returns:
  437. // true if a key press is available; otherwise, false.
  438. //
  439. // Exceptions:
  440. // T:System.IO.IOException:
  441. // An I/O error occurred.
  442. //
  443. // T:System.InvalidOperationException:
  444. // Standard input is redirected to a file instead of the keyboard.
  445. /// <summary>
  446. ///
  447. /// </summary>
  448. public static bool KeyAvailable { get; }
  449. //
  450. // Summary:
  451. // Gets a value indicating whether the NUM LOCK keyboard toggle is turned on or
  452. // turned off.
  453. //
  454. // Returns:
  455. // true if NUM LOCK is turned on; false if NUM LOCK is turned off.
  456. /// <summary>
  457. ///
  458. /// </summary>
  459. public static bool NumberLock { get; }
  460. //
  461. // Summary:
  462. // Gets a value indicating whether the CAPS LOCK keyboard toggle is turned on or
  463. // turned off.
  464. //
  465. // Returns:
  466. // true if CAPS LOCK is turned on; false if CAPS LOCK is turned off.
  467. /// <summary>
  468. ///
  469. /// </summary>
  470. public static bool CapsLock { get; }
  471. //
  472. // Summary:
  473. // Gets a value that indicates whether input has been redirected from the standard
  474. // input stream.
  475. //
  476. // Returns:
  477. // true if input is redirected; otherwise, false.
  478. /// <summary>
  479. ///
  480. /// </summary>
  481. public static bool IsInputRedirected { get; }
  482. //
  483. // Summary:
  484. // Plays the sound of a beep through the console speaker.
  485. //
  486. // Exceptions:
  487. // T:System.Security.HostProtectionException:
  488. // This method was executed on a server, such as SQL Server, that does not permit
  489. // access to a user interface.
  490. /// <summary>
  491. ///
  492. /// </summary>
  493. public static void Beep ()
  494. {
  495. throw new NotImplementedException ();
  496. }
  497. //
  498. // Summary:
  499. // Plays the sound of a beep of a specified frequency and duration through the console
  500. // speaker.
  501. //
  502. // Parameters:
  503. // frequency:
  504. // The frequency of the beep, ranging from 37 to 32767 hertz.
  505. //
  506. // duration:
  507. // The duration of the beep measured in milliseconds.
  508. //
  509. // Exceptions:
  510. // T:System.ArgumentOutOfRangeException:
  511. // frequency is less than 37 or more than 32767 hertz.-or- duration is less than
  512. // or equal to zero.
  513. //
  514. // T:System.Security.HostProtectionException:
  515. // This method was executed on a server, such as SQL Server, that does not permit
  516. // access to the console.
  517. /// <summary>
  518. ///
  519. /// </summary>
  520. public static void Beep (int frequency, int duration)
  521. {
  522. throw new NotImplementedException ();
  523. }
  524. //
  525. // Summary:
  526. // Clears the console buffer and corresponding console window of display information.
  527. //
  528. // Exceptions:
  529. // T:System.IO.IOException:
  530. // An I/O error occurred.
  531. static char [,] _buffer = new char [WindowWidth, WindowHeight];
  532. /// <summary>
  533. ///
  534. /// </summary>
  535. public static void Clear ()
  536. {
  537. _buffer = new char [BufferWidth, BufferHeight];
  538. SetCursorPosition (0, 0);
  539. }
  540. //
  541. // Summary:
  542. // Copies a specified source area of the screen buffer to a specified destination
  543. // area.
  544. //
  545. // Parameters:
  546. // sourceLeft:
  547. // The leftmost column of the source area.
  548. //
  549. // sourceTop:
  550. // The topmost row of the source area.
  551. //
  552. // sourceWidth:
  553. // The number of columns in the source area.
  554. //
  555. // sourceHeight:
  556. // The number of rows in the source area.
  557. //
  558. // targetLeft:
  559. // The leftmost column of the destination area.
  560. //
  561. // targetTop:
  562. // The topmost row of the destination area.
  563. //
  564. // Exceptions:
  565. // T:System.ArgumentOutOfRangeException:
  566. // One or more of the parameters is less than zero.-or- sourceLeft or targetLeft
  567. // is greater than or equal to System.Console.BufferWidth.-or- sourceTop or targetTop
  568. // is greater than or equal to System.Console.BufferHeight.-or- sourceTop + sourceHeight
  569. // is greater than or equal to System.Console.BufferHeight.-or- sourceLeft + sourceWidth
  570. // is greater than or equal to System.Console.BufferWidth.
  571. //
  572. // T:System.Security.SecurityException:
  573. // The user does not have permission to perform this action.
  574. //
  575. // T:System.IO.IOException:
  576. // An I/O error occurred.
  577. /// <summary>
  578. ///
  579. /// </summary>
  580. public static void MoveBufferArea (int sourceLeft, int sourceTop, int sourceWidth, int sourceHeight, int targetLeft, int targetTop)
  581. {
  582. throw new NotImplementedException ();
  583. }
  584. //
  585. // Summary:
  586. // Copies a specified source area of the screen buffer to a specified destination
  587. // area.
  588. //
  589. // Parameters:
  590. // sourceLeft:
  591. // The leftmost column of the source area.
  592. //
  593. // sourceTop:
  594. // The topmost row of the source area.
  595. //
  596. // sourceWidth:
  597. // The number of columns in the source area.
  598. //
  599. // sourceHeight:
  600. // The number of rows in the source area.
  601. //
  602. // targetLeft:
  603. // The leftmost column of the destination area.
  604. //
  605. // targetTop:
  606. // The topmost row of the destination area.
  607. //
  608. // sourceChar:
  609. // The character used to fill the source area.
  610. //
  611. // sourceForeColor:
  612. // The foreground color used to fill the source area.
  613. //
  614. // sourceBackColor:
  615. // The background color used to fill the source area.
  616. //
  617. // Exceptions:
  618. // T:System.ArgumentOutOfRangeException:
  619. // One or more of the parameters is less than zero.-or- sourceLeft or targetLeft
  620. // is greater than or equal to System.Console.BufferWidth.-or- sourceTop or targetTop
  621. // is greater than or equal to System.Console.BufferHeight.-or- sourceTop + sourceHeight
  622. // is greater than or equal to System.Console.BufferHeight.-or- sourceLeft + sourceWidth
  623. // is greater than or equal to System.Console.BufferWidth.
  624. //
  625. // T:System.ArgumentException:
  626. // One or both of the color parameters is not a member of the System.ConsoleColor
  627. // enumeration.
  628. //
  629. // T:System.Security.SecurityException:
  630. // The user does not have permission to perform this action.
  631. //
  632. // T:System.IO.IOException:
  633. // An I/O error occurred.
  634. //[SecuritySafeCritical]
  635. /// <summary>
  636. ///
  637. /// </summary>
  638. public static void MoveBufferArea (int sourceLeft, int sourceTop, int sourceWidth, int sourceHeight, int targetLeft, int targetTop, char sourceChar, ConsoleColor sourceForeColor, ConsoleColor sourceBackColor)
  639. {
  640. throw new NotImplementedException ();
  641. }
  642. //
  643. // Summary:
  644. // Acquires the standard error stream.
  645. //
  646. // Returns:
  647. // The standard error stream.
  648. /// <summary>
  649. ///
  650. /// </summary>
  651. public static Stream OpenStandardError ()
  652. {
  653. throw new NotImplementedException ();
  654. }
  655. //
  656. // Summary:
  657. // Acquires the standard error stream, which is set to a specified buffer size.
  658. //
  659. // Parameters:
  660. // bufferSize:
  661. // The internal stream buffer size.
  662. //
  663. // Returns:
  664. // The standard error stream.
  665. //
  666. // Exceptions:
  667. // T:System.ArgumentOutOfRangeException:
  668. // bufferSize is less than or equal to zero.
  669. /// <summary>
  670. ///
  671. /// </summary>
  672. public static Stream OpenStandardError (int bufferSize)
  673. {
  674. throw new NotImplementedException ();
  675. }
  676. //
  677. // Summary:
  678. // Acquires the standard input stream, which is set to a specified buffer size.
  679. //
  680. // Parameters:
  681. // bufferSize:
  682. // The internal stream buffer size.
  683. //
  684. // Returns:
  685. // The standard input stream.
  686. //
  687. // Exceptions:
  688. // T:System.ArgumentOutOfRangeException:
  689. // bufferSize is less than or equal to zero.
  690. /// <summary>
  691. ///
  692. /// </summary>
  693. public static Stream OpenStandardInput (int bufferSize)
  694. {
  695. throw new NotImplementedException ();
  696. }
  697. //
  698. // Summary:
  699. // Acquires the standard input stream.
  700. //
  701. // Returns:
  702. // The standard input stream.
  703. /// <summary>
  704. ///
  705. /// </summary>
  706. public static Stream OpenStandardInput ()
  707. {
  708. throw new NotImplementedException ();
  709. }
  710. //
  711. // Summary:
  712. // Acquires the standard output stream, which is set to a specified buffer size.
  713. //
  714. // Parameters:
  715. // bufferSize:
  716. // The internal stream buffer size.
  717. //
  718. // Returns:
  719. // The standard output stream.
  720. //
  721. // Exceptions:
  722. // T:System.ArgumentOutOfRangeException:
  723. // bufferSize is less than or equal to zero.
  724. /// <summary>
  725. ///
  726. /// </summary>
  727. public static Stream OpenStandardOutput (int bufferSize)
  728. {
  729. throw new NotImplementedException ();
  730. }
  731. //
  732. // Summary:
  733. // Acquires the standard output stream.
  734. //
  735. // Returns:
  736. // The standard output stream.
  737. /// <summary>
  738. ///
  739. /// </summary>
  740. public static Stream OpenStandardOutput ()
  741. {
  742. throw new NotImplementedException ();
  743. }
  744. //
  745. // Summary:
  746. // Reads the next character from the standard input stream.
  747. //
  748. // Returns:
  749. // The next character from the input stream, or negative one (-1) if there are currently
  750. // no more characters to be read.
  751. //
  752. // Exceptions:
  753. // T:System.IO.IOException:
  754. // An I/O error occurred.
  755. /// <summary>
  756. ///
  757. /// </summary>
  758. public static int Read ()
  759. {
  760. throw new NotImplementedException ();
  761. }
  762. //
  763. // Summary:
  764. // Obtains the next character or function key pressed by the user. The pressed key
  765. // is optionally displayed in the console window.
  766. //
  767. // Parameters:
  768. // intercept:
  769. // Determines whether to display the pressed key in the console window. true to
  770. // not display the pressed key; otherwise, false.
  771. //
  772. // Returns:
  773. // An object that describes the System.ConsoleKey constant and Unicode character,
  774. // if any, that correspond to the pressed console key. The System.ConsoleKeyInfo
  775. // object also describes, in a bitwise combination of System.ConsoleModifiers values,
  776. // whether one or more Shift, Alt, or Ctrl modifier keys was pressed simultaneously
  777. // with the console key.
  778. //
  779. // Exceptions:
  780. // T:System.InvalidOperationException:
  781. // The System.Console.In property is redirected from some stream other than the
  782. // console.
  783. //[SecuritySafeCritical]
  784. /// <summary>
  785. ///
  786. /// </summary>
  787. public static ConsoleKeyInfo ReadKey (bool intercept)
  788. {
  789. if (MockKeyPresses.Count > 0) {
  790. return MockKeyPresses.Pop ();
  791. } else {
  792. return new ConsoleKeyInfo ('\0', (ConsoleKey)'\0', false, false, false);
  793. }
  794. }
  795. /// <summary>
  796. /// A stack of keypresses to return when ReadKey is called.
  797. /// </summary>
  798. public static Stack<ConsoleKeyInfo> MockKeyPresses = new Stack<ConsoleKeyInfo> ();
  799. /// <summary>
  800. /// Helper to push a <see cref="Key"/> onto <see cref="MockKeyPresses"/>.
  801. /// </summary>
  802. /// <param name="key"></param>
  803. public static void PushMockKeyPress (Key key)
  804. {
  805. MockKeyPresses.Push (new ConsoleKeyInfo (
  806. (char)(key & ~Key.CtrlMask & ~Key.ShiftMask & ~Key.AltMask),
  807. ConsoleKeyMapping.GetConsoleKeyFromKey (key),
  808. key.HasFlag (Key.ShiftMask),
  809. key.HasFlag (Key.AltMask),
  810. key.HasFlag (Key.CtrlMask)));
  811. }
  812. //
  813. // Summary:
  814. // Obtains the next character or function key pressed by the user. The pressed key
  815. // is displayed in the console window.
  816. //
  817. // Returns:
  818. // An object that describes the System.ConsoleKey constant and Unicode character,
  819. // if any, that correspond to the pressed console key. The System.ConsoleKeyInfo
  820. // object also describes, in a bitwise combination of System.ConsoleModifiers values,
  821. // whether one or more Shift, Alt, or Ctrl modifier keys was pressed simultaneously
  822. // with the console key.
  823. //
  824. // Exceptions:
  825. // T:System.InvalidOperationException:
  826. // The System.Console.In property is redirected from some stream other than the
  827. // console.
  828. /// <summary>
  829. ///
  830. /// </summary>
  831. public static ConsoleKeyInfo ReadKey ()
  832. {
  833. throw new NotImplementedException ();
  834. }
  835. //
  836. // Summary:
  837. // Reads the next line of characters from the standard input stream.
  838. //
  839. // Returns:
  840. // The next line of characters from the input stream, or null if no more lines are
  841. // available.
  842. //
  843. // Exceptions:
  844. // T:System.IO.IOException:
  845. // An I/O error occurred.
  846. //
  847. // T:System.OutOfMemoryException:
  848. // There is insufficient memory to allocate a buffer for the returned string.
  849. //
  850. // T:System.ArgumentOutOfRangeException:
  851. // The number of characters in the next line of characters is greater than System.Int32.MaxValue.
  852. /// <summary>
  853. ///
  854. /// </summary>
  855. public static string ReadLine ()
  856. {
  857. throw new NotImplementedException ();
  858. }
  859. //
  860. // Summary:
  861. // Sets the foreground and background console colors to their defaults.
  862. //
  863. // Exceptions:
  864. // T:System.Security.SecurityException:
  865. // The user does not have permission to perform this action.
  866. //
  867. // T:System.IO.IOException:
  868. // An I/O error occurred.
  869. //[SecuritySafeCritical]
  870. /// <summary>
  871. ///
  872. /// </summary>
  873. public static void ResetColor ()
  874. {
  875. BackgroundColor = _defaultBackgroundColor;
  876. ForegroundColor = _defaultForegroundColor;
  877. }
  878. //
  879. // Summary:
  880. // Sets the height and width of the screen buffer area to the specified values.
  881. //
  882. // Parameters:
  883. // width:
  884. // The width of the buffer area measured in columns.
  885. //
  886. // height:
  887. // The height of the buffer area measured in rows.
  888. //
  889. // Exceptions:
  890. // T:System.ArgumentOutOfRangeException:
  891. // height or width is less than or equal to zero.-or- height or width is greater
  892. // than or equal to System.Int16.MaxValue.-or- width is less than System.Console.WindowLeft
  893. // + System.Console.WindowWidth.-or- height is less than System.Console.WindowTop
  894. // + System.Console.WindowHeight.
  895. //
  896. // T:System.Security.SecurityException:
  897. // The user does not have permission to perform this action.
  898. //
  899. // T:System.IO.IOException:
  900. // An I/O error occurred.
  901. //[SecuritySafeCritical]
  902. /// <summary>
  903. ///
  904. /// </summary>
  905. public static void SetBufferSize (int width, int height)
  906. {
  907. BufferWidth = width;
  908. BufferHeight = height;
  909. _buffer = new char [BufferWidth, BufferHeight];
  910. }
  911. //
  912. // Summary:
  913. // Sets the position of the cursor.
  914. //
  915. // Parameters:
  916. // left:
  917. // The column position of the cursor. Columns are numbered from left to right starting
  918. // at 0.
  919. //
  920. // top:
  921. // The row position of the cursor. Rows are numbered from top to bottom starting
  922. // at 0.
  923. //
  924. // Exceptions:
  925. // T:System.ArgumentOutOfRangeException:
  926. // left or top is less than zero.-or- left is greater than or equal to System.Console.BufferWidth.-or-
  927. // top is greater than or equal to System.Console.BufferHeight.
  928. //
  929. // T:System.Security.SecurityException:
  930. // The user does not have permission to perform this action.
  931. //
  932. // T:System.IO.IOException:
  933. // An I/O error occurred.
  934. //[SecuritySafeCritical]
  935. /// <summary>
  936. ///
  937. /// </summary>
  938. public static void SetCursorPosition (int left, int top)
  939. {
  940. CursorLeft = left;
  941. CursorTop = top;
  942. WindowLeft = Math.Max (Math.Min (left, BufferWidth - WindowWidth), 0);
  943. WindowTop = Math.Max (Math.Min (top, BufferHeight - WindowHeight), 0);
  944. }
  945. //
  946. // Summary:
  947. // Sets the System.Console.Error property to the specified System.IO.TextWriter
  948. // object.
  949. //
  950. // Parameters:
  951. // newError:
  952. // A stream that is the new standard error output.
  953. //
  954. // Exceptions:
  955. // T:System.ArgumentNullException:
  956. // newError is null.
  957. //
  958. // T:System.Security.SecurityException:
  959. // The caller does not have the required permission.
  960. //[SecuritySafeCritical]
  961. /// <summary>
  962. ///
  963. /// </summary>
  964. public static void SetError (TextWriter newError)
  965. {
  966. throw new NotImplementedException ();
  967. }
  968. //
  969. // Summary:
  970. // Sets the System.Console.In property to the specified System.IO.TextReader object.
  971. //
  972. // Parameters:
  973. // newIn:
  974. // A stream that is the new standard input.
  975. //
  976. // Exceptions:
  977. // T:System.ArgumentNullException:
  978. // newIn is null.
  979. //
  980. // T:System.Security.SecurityException:
  981. // The caller does not have the required permission.
  982. //[SecuritySafeCritical]
  983. /// <summary>
  984. ///
  985. /// </summary>
  986. public static void SetIn (TextReader newIn)
  987. {
  988. throw new NotImplementedException ();
  989. }
  990. //
  991. // Summary:
  992. // Sets the System.Console.Out property to the specified System.IO.TextWriter object.
  993. //
  994. // Parameters:
  995. // newOut:
  996. // A stream that is the new standard output.
  997. //
  998. // Exceptions:
  999. // T:System.ArgumentNullException:
  1000. // newOut is null.
  1001. //
  1002. // T:System.Security.SecurityException:
  1003. // The caller does not have the required permission.
  1004. //[SecuritySafeCritical]
  1005. /// <summary>
  1006. ///
  1007. /// </summary>
  1008. /// <param name="newOut"></param>
  1009. public static void SetOut (TextWriter newOut)
  1010. {
  1011. throw new NotImplementedException ();
  1012. }
  1013. //
  1014. // Summary:
  1015. // Sets the position of the console window relative to the screen buffer.
  1016. //
  1017. // Parameters:
  1018. // left:
  1019. // The column position of the upper left corner of the console window.
  1020. //
  1021. // top:
  1022. // The row position of the upper left corner of the console window.
  1023. //
  1024. // Exceptions:
  1025. // T:System.ArgumentOutOfRangeException:
  1026. // left or top is less than zero.-or- left + System.Console.WindowWidth is greater
  1027. // than System.Console.BufferWidth.-or- top + System.Console.WindowHeight is greater
  1028. // than System.Console.BufferHeight.
  1029. //
  1030. // T:System.Security.SecurityException:
  1031. // The user does not have permission to perform this action.
  1032. //
  1033. // T:System.IO.IOException:
  1034. // An I/O error occurred.
  1035. //[SecuritySafeCritical]
  1036. /// <summary>
  1037. ///
  1038. /// </summary>
  1039. /// <param name="left"></param>
  1040. /// <param name="top"></param>
  1041. public static void SetWindowPosition (int left, int top)
  1042. {
  1043. WindowLeft = left;
  1044. WindowTop = top;
  1045. }
  1046. //
  1047. // Summary:
  1048. // Sets the height and width of the console window to the specified values.
  1049. //
  1050. // Parameters:
  1051. // width:
  1052. // The width of the console window measured in columns.
  1053. //
  1054. // height:
  1055. // The height of the console window measured in rows.
  1056. //
  1057. // Exceptions:
  1058. // T:System.ArgumentOutOfRangeException:
  1059. // width or height is less than or equal to zero.-or- width plus System.Console.WindowLeft
  1060. // or height plus System.Console.WindowTop is greater than or equal to System.Int16.MaxValue.
  1061. // -or- width or height is greater than the largest possible window width or height
  1062. // for the current screen resolution and console font.
  1063. //
  1064. // T:System.Security.SecurityException:
  1065. // The user does not have permission to perform this action.
  1066. //
  1067. // T:System.IO.IOException:
  1068. // An I/O error occurred.
  1069. //[SecuritySafeCritical]
  1070. /// <summary>
  1071. ///
  1072. /// </summary>
  1073. /// <param name="width"></param>
  1074. /// <param name="height"></param>
  1075. public static void SetWindowSize (int width, int height)
  1076. {
  1077. WindowWidth = width;
  1078. WindowHeight = height;
  1079. }
  1080. //
  1081. // Summary:
  1082. // Writes the specified string value to the standard output stream.
  1083. //
  1084. // Parameters:
  1085. // value:
  1086. // The value to write.
  1087. //
  1088. // Exceptions:
  1089. // T:System.IO.IOException:
  1090. // An I/O error occurred.
  1091. /// <summary>
  1092. ///
  1093. /// </summary>
  1094. /// <param name="value"></param>
  1095. public static void Write (string value)
  1096. {
  1097. throw new NotImplementedException ();
  1098. }
  1099. //
  1100. // Summary:
  1101. // Writes the text representation of the specified object to the standard output
  1102. // stream.
  1103. //
  1104. // Parameters:
  1105. // value:
  1106. // The value to write, or null.
  1107. //
  1108. // Exceptions:
  1109. // T:System.IO.IOException:
  1110. // An I/O error occurred.
  1111. /// <summary>
  1112. ///
  1113. /// </summary>
  1114. /// <param name="value"></param>
  1115. public static void Write (object value)
  1116. {
  1117. throw new NotImplementedException ();
  1118. }
  1119. //
  1120. // Summary:
  1121. // Writes the text representation of the specified 64-bit unsigned integer value
  1122. // to the standard output stream.
  1123. //
  1124. // Parameters:
  1125. // value:
  1126. // The value to write.
  1127. //
  1128. // Exceptions:
  1129. // T:System.IO.IOException:
  1130. // An I/O error occurred.
  1131. //[CLSCompliant (false)]
  1132. /// <summary>
  1133. ///
  1134. /// </summary>
  1135. /// <param name="value"></param>
  1136. public static void Write (ulong value)
  1137. {
  1138. throw new NotImplementedException ();
  1139. }
  1140. //
  1141. // Summary:
  1142. // Writes the text representation of the specified 64-bit signed integer value to
  1143. // the standard output stream.
  1144. //
  1145. // Parameters:
  1146. // value:
  1147. // The value to write.
  1148. //
  1149. // Exceptions:
  1150. // T:System.IO.IOException:
  1151. // An I/O error occurred.
  1152. /// <summary>
  1153. ///
  1154. /// </summary>
  1155. /// <param name="value"></param>
  1156. public static void Write (long value)
  1157. {
  1158. throw new NotImplementedException ();
  1159. }
  1160. //
  1161. // Summary:
  1162. // Writes the text representation of the specified objects to the standard output
  1163. // stream using the specified format information.
  1164. //
  1165. // Parameters:
  1166. // format:
  1167. // A composite format string (see Remarks).
  1168. //
  1169. // arg0:
  1170. // The first object to write using format.
  1171. //
  1172. // arg1:
  1173. // The second object to write using format.
  1174. //
  1175. // Exceptions:
  1176. // T:System.IO.IOException:
  1177. // An I/O error occurred.
  1178. //
  1179. // T:System.ArgumentNullException:
  1180. // format is null.
  1181. //
  1182. // T:System.FormatException:
  1183. // The format specification in format is invalid.
  1184. /// <summary>
  1185. ///
  1186. /// </summary>
  1187. /// <param name="format"></param>
  1188. /// <param name="arg0"></param>
  1189. /// <param name="arg1"></param>
  1190. public static void Write (string format, object arg0, object arg1)
  1191. {
  1192. throw new NotImplementedException ();
  1193. }
  1194. //
  1195. // Summary:
  1196. // Writes the text representation of the specified 32-bit signed integer value to
  1197. // the standard output stream.
  1198. //
  1199. // Parameters:
  1200. // value:
  1201. // The value to write.
  1202. //
  1203. // Exceptions:
  1204. // T:System.IO.IOException:
  1205. // An I/O error occurred.
  1206. /// <summary>
  1207. ///
  1208. /// </summary>
  1209. /// <param name="value"></param>
  1210. public static void Write (int value)
  1211. {
  1212. throw new NotImplementedException ();
  1213. }
  1214. //
  1215. // Summary:
  1216. // Writes the text representation of the specified object to the standard output
  1217. // stream using the specified format information.
  1218. //
  1219. // Parameters:
  1220. // format:
  1221. // A composite format string (see Remarks).
  1222. //
  1223. // arg0:
  1224. // An object to write using format.
  1225. //
  1226. // Exceptions:
  1227. // T:System.IO.IOException:
  1228. // An I/O error occurred.
  1229. //
  1230. // T:System.ArgumentNullException:
  1231. // format is null.
  1232. //
  1233. // T:System.FormatException:
  1234. // The format specification in format is invalid.
  1235. /// <summary>
  1236. ///
  1237. /// </summary>
  1238. /// <param name="format"></param>
  1239. /// <param name="arg0"></param>
  1240. public static void Write (string format, object arg0)
  1241. {
  1242. throw new NotImplementedException ();
  1243. }
  1244. //
  1245. // Summary:
  1246. // Writes the text representation of the specified 32-bit unsigned integer value
  1247. // to the standard output stream.
  1248. //
  1249. // Parameters:
  1250. // value:
  1251. // The value to write.
  1252. //
  1253. // Exceptions:
  1254. // T:System.IO.IOException:
  1255. // An I/O error occurred.
  1256. //[CLSCompliant (false)]
  1257. /// <summary>
  1258. ///
  1259. /// </summary>
  1260. /// <param name="value"></param>
  1261. public static void Write (uint value)
  1262. {
  1263. throw new NotImplementedException ();
  1264. }
  1265. //[CLSCompliant (false)]
  1266. /// <summary>
  1267. ///
  1268. /// </summary>
  1269. /// <param name="format"></param>
  1270. /// <param name="arg0"></param>
  1271. /// <param name="arg1"></param>
  1272. /// <param name="arg2"></param>
  1273. /// <param name="arg3"></param>
  1274. public static void Write (string format, object arg0, object arg1, object arg2, object arg3)
  1275. {
  1276. throw new NotImplementedException ();
  1277. }
  1278. //
  1279. // Summary:
  1280. // Writes the text representation of the specified array of objects to the standard
  1281. // output stream using the specified format information.
  1282. //
  1283. // Parameters:
  1284. // format:
  1285. // A composite format string (see Remarks).
  1286. //
  1287. // arg:
  1288. // An array of objects to write using format.
  1289. //
  1290. // Exceptions:
  1291. // T:System.IO.IOException:
  1292. // An I/O error occurred.
  1293. //
  1294. // T:System.ArgumentNullException:
  1295. // format or arg is null.
  1296. //
  1297. // T:System.FormatException:
  1298. // The format specification in format is invalid.
  1299. /// <summary>
  1300. ///
  1301. /// </summary>
  1302. /// <param name="format"></param>
  1303. /// <param name="arg"></param>
  1304. public static void Write (string format, params object [] arg)
  1305. {
  1306. throw new NotImplementedException ();
  1307. }
  1308. //
  1309. // Summary:
  1310. // Writes the text representation of the specified Boolean value to the standard
  1311. // output stream.
  1312. //
  1313. // Parameters:
  1314. // value:
  1315. // The value to write.
  1316. //
  1317. // Exceptions:
  1318. // T:System.IO.IOException:
  1319. // An I/O error occurred.
  1320. /// <summary>
  1321. ///
  1322. /// </summary>
  1323. /// <param name="value"></param>
  1324. public static void Write (bool value)
  1325. {
  1326. throw new NotImplementedException ();
  1327. }
  1328. //
  1329. // Summary:
  1330. // Writes the specified Unicode character value to the standard output stream.
  1331. //
  1332. // Parameters:
  1333. // value:
  1334. // The value to write.
  1335. //
  1336. // Exceptions:
  1337. // T:System.IO.IOException:
  1338. // An I/O error occurred.
  1339. /// <summary>
  1340. ///
  1341. /// </summary>
  1342. /// <param name="value"></param>
  1343. public static void Write (char value)
  1344. {
  1345. _buffer [CursorLeft, CursorTop] = value;
  1346. }
  1347. //
  1348. // Summary:
  1349. // Writes the specified array of Unicode characters to the standard output stream.
  1350. //
  1351. // Parameters:
  1352. // buffer:
  1353. // A Unicode character array.
  1354. //
  1355. // Exceptions:
  1356. // T:System.IO.IOException:
  1357. // An I/O error occurred.
  1358. /// <summary>
  1359. ///
  1360. /// </summary>
  1361. /// <param name="buffer"></param>
  1362. public static void Write (char [] buffer)
  1363. {
  1364. _buffer [CursorLeft, CursorTop] = (char)0;
  1365. foreach (var ch in buffer) {
  1366. _buffer [CursorLeft, CursorTop] += ch;
  1367. }
  1368. }
  1369. //
  1370. // Summary:
  1371. // Writes the specified subarray of Unicode characters to the standard output stream.
  1372. //
  1373. // Parameters:
  1374. // buffer:
  1375. // An array of Unicode characters.
  1376. //
  1377. // index:
  1378. // The starting position in buffer.
  1379. //
  1380. // count:
  1381. // The number of characters to write.
  1382. //
  1383. // Exceptions:
  1384. // T:System.ArgumentNullException:
  1385. // buffer is null.
  1386. //
  1387. // T:System.ArgumentOutOfRangeException:
  1388. // index or count is less than zero.
  1389. //
  1390. // T:System.ArgumentException:
  1391. // index plus count specify a position that is not within buffer.
  1392. //
  1393. // T:System.IO.IOException:
  1394. // An I/O error occurred.
  1395. /// <summary>
  1396. ///
  1397. /// </summary>
  1398. /// <param name="buffer"></param>
  1399. /// <param name="index"></param>
  1400. /// <param name="count"></param>
  1401. public static void Write (char [] buffer, int index, int count)
  1402. {
  1403. throw new NotImplementedException ();
  1404. }
  1405. //
  1406. // Summary:
  1407. // Writes the text representation of the specified objects to the standard output
  1408. // stream using the specified format information.
  1409. //
  1410. // Parameters:
  1411. // format:
  1412. // A composite format string (see Remarks).
  1413. //
  1414. // arg0:
  1415. // The first object to write using format.
  1416. //
  1417. // arg1:
  1418. // The second object to write using format.
  1419. //
  1420. // arg2:
  1421. // The third object to write using format.
  1422. //
  1423. // Exceptions:
  1424. // T:System.IO.IOException:
  1425. // An I/O error occurred.
  1426. //
  1427. // T:System.ArgumentNullException:
  1428. // format is null.
  1429. //
  1430. // T:System.FormatException:
  1431. // The format specification in format is invalid.
  1432. /// <summary>
  1433. ///
  1434. /// </summary>
  1435. /// <param name="format"></param>
  1436. /// <param name="arg0"></param>
  1437. /// <param name="arg1"></param>
  1438. /// <param name="arg2"></param>
  1439. public static void Write (string format, object arg0, object arg1, object arg2)
  1440. {
  1441. throw new NotImplementedException ();
  1442. }
  1443. //
  1444. // Summary:
  1445. // Writes the text representation of the specified System.Decimal value to the standard
  1446. // output stream.
  1447. //
  1448. // Parameters:
  1449. // value:
  1450. // The value to write.
  1451. //
  1452. // Exceptions:
  1453. // T:System.IO.IOException:
  1454. // An I/O error occurred.
  1455. /// <summary>
  1456. ///
  1457. /// </summary>
  1458. /// <param name="value"></param>
  1459. public static void Write (decimal value)
  1460. {
  1461. throw new NotImplementedException ();
  1462. }
  1463. //
  1464. // Summary:
  1465. // Writes the text representation of the specified single-precision floating-point
  1466. // value to the standard output stream.
  1467. //
  1468. // Parameters:
  1469. // value:
  1470. // The value to write.
  1471. //
  1472. // Exceptions:
  1473. // T:System.IO.IOException:
  1474. // An I/O error occurred.
  1475. /// <summary>
  1476. ///
  1477. /// </summary>
  1478. /// <param name="value"></param>
  1479. public static void Write (float value)
  1480. {
  1481. throw new NotImplementedException ();
  1482. }
  1483. //
  1484. // Summary:
  1485. // Writes the text representation of the specified double-precision floating-point
  1486. // value to the standard output stream.
  1487. //
  1488. // Parameters:
  1489. // value:
  1490. // The value to write.
  1491. //
  1492. // Exceptions:
  1493. // T:System.IO.IOException:
  1494. // An I/O error occurred.
  1495. /// <summary>
  1496. ///
  1497. /// </summary>
  1498. /// <param name="value"></param>
  1499. public static void Write (double value)
  1500. {
  1501. throw new NotImplementedException ();
  1502. }
  1503. //
  1504. // Summary:
  1505. // Writes the current line terminator to the standard output stream.
  1506. //
  1507. // Exceptions:
  1508. // T:System.IO.IOException:
  1509. // An I/O error occurred.
  1510. /// <summary>
  1511. ///
  1512. /// </summary>
  1513. public static void WriteLine ()
  1514. {
  1515. throw new NotImplementedException ();
  1516. }
  1517. //
  1518. // Summary:
  1519. // Writes the text representation of the specified single-precision floating-point
  1520. // value, followed by the current line terminator, to the standard output stream.
  1521. //
  1522. // Parameters:
  1523. // value:
  1524. // The value to write.
  1525. //
  1526. // Exceptions:
  1527. // T:System.IO.IOException:
  1528. // An I/O error occurred.
  1529. /// <summary>
  1530. ///
  1531. /// </summary>
  1532. /// <param name="value"></param>
  1533. public static void WriteLine (float value)
  1534. {
  1535. throw new NotImplementedException ();
  1536. }
  1537. //
  1538. // Summary:
  1539. // Writes the text representation of the specified 32-bit signed integer value,
  1540. // followed by the current line terminator, to the standard output stream.
  1541. //
  1542. // Parameters:
  1543. // value:
  1544. // The value to write.
  1545. //
  1546. // Exceptions:
  1547. // T:System.IO.IOException:
  1548. // An I/O error occurred.
  1549. /// <summary>
  1550. ///
  1551. /// </summary>
  1552. /// <param name="value"></param>
  1553. public static void WriteLine (int value)
  1554. {
  1555. throw new NotImplementedException ();
  1556. }
  1557. //
  1558. // Summary:
  1559. // Writes the text representation of the specified 32-bit unsigned integer value,
  1560. // followed by the current line terminator, to the standard output stream.
  1561. //
  1562. // Parameters:
  1563. // value:
  1564. // The value to write.
  1565. //
  1566. // Exceptions:
  1567. // T:System.IO.IOException:
  1568. // An I/O error occurred.
  1569. //[CLSCompliant (false)]
  1570. /// <summary>
  1571. ///
  1572. /// </summary>
  1573. /// <param name="value"></param>
  1574. public static void WriteLine (uint value)
  1575. {
  1576. throw new NotImplementedException ();
  1577. }
  1578. //
  1579. // Summary:
  1580. // Writes the text representation of the specified 64-bit signed integer value,
  1581. // followed by the current line terminator, to the standard output stream.
  1582. //
  1583. // Parameters:
  1584. // value:
  1585. // The value to write.
  1586. //
  1587. // Exceptions:
  1588. // T:System.IO.IOException:
  1589. // An I/O error occurred.
  1590. /// <summary>
  1591. ///
  1592. /// </summary>
  1593. /// <param name="value"></param>
  1594. public static void WriteLine (long value)
  1595. {
  1596. throw new NotImplementedException ();
  1597. }
  1598. //
  1599. // Summary:
  1600. // Writes the text representation of the specified 64-bit unsigned integer value,
  1601. // followed by the current line terminator, to the standard output stream.
  1602. //
  1603. // Parameters:
  1604. // value:
  1605. // The value to write.
  1606. //
  1607. // Exceptions:
  1608. // T:System.IO.IOException:
  1609. // An I/O error occurred.
  1610. //[CLSCompliant (false)]
  1611. /// <summary>
  1612. ///
  1613. /// </summary>
  1614. /// <param name="value"></param>
  1615. public static void WriteLine (ulong value)
  1616. {
  1617. throw new NotImplementedException ();
  1618. }
  1619. //
  1620. // Summary:
  1621. // Writes the text representation of the specified object, followed by the current
  1622. // line terminator, to the standard output stream.
  1623. //
  1624. // Parameters:
  1625. // value:
  1626. // The value to write.
  1627. //
  1628. // Exceptions:
  1629. // T:System.IO.IOException:
  1630. // An I/O error occurred.
  1631. /// <summary>
  1632. ///
  1633. /// </summary>
  1634. /// <param name="value"></param>
  1635. public static void WriteLine (object value)
  1636. {
  1637. throw new NotImplementedException ();
  1638. }
  1639. //
  1640. // Summary:
  1641. // Writes the specified string value, followed by the current line terminator, to
  1642. // the standard output stream.
  1643. //
  1644. // Parameters:
  1645. // value:
  1646. // The value to write.
  1647. //
  1648. // Exceptions:
  1649. // T:System.IO.IOException:
  1650. // An I/O error occurred.
  1651. /// <summary>
  1652. ///
  1653. /// </summary>
  1654. /// <param name="value"></param>
  1655. public static void WriteLine (string value)
  1656. {
  1657. throw new NotImplementedException ();
  1658. }
  1659. //
  1660. // Summary:
  1661. // Writes the text representation of the specified object, followed by the current
  1662. // line terminator, to the standard output stream using the specified format information.
  1663. //
  1664. // Parameters:
  1665. // format:
  1666. // A composite format string (see Remarks).
  1667. //
  1668. // arg0:
  1669. // An object to write using format.
  1670. //
  1671. // Exceptions:
  1672. // T:System.IO.IOException:
  1673. // An I/O error occurred.
  1674. //
  1675. // T:System.ArgumentNullException:
  1676. // format is null.
  1677. //
  1678. // T:System.FormatException:
  1679. // The format specification in format is invalid.
  1680. /// <summary>
  1681. ///
  1682. /// </summary>
  1683. /// <param name="format"></param>
  1684. /// <param name="arg0"></param>
  1685. public static void WriteLine (string format, object arg0)
  1686. {
  1687. throw new NotImplementedException ();
  1688. }
  1689. //
  1690. // Summary:
  1691. // Writes the text representation of the specified objects, followed by the current
  1692. // line terminator, to the standard output stream using the specified format information.
  1693. //
  1694. // Parameters:
  1695. // format:
  1696. // A composite format string (see Remarks).
  1697. //
  1698. // arg0:
  1699. // The first object to write using format.
  1700. //
  1701. // arg1:
  1702. // The second object to write using format.
  1703. //
  1704. // arg2:
  1705. // The third object to write using format.
  1706. //
  1707. // Exceptions:
  1708. // T:System.IO.IOException:
  1709. // An I/O error occurred.
  1710. //
  1711. // T:System.ArgumentNullException:
  1712. // format is null.
  1713. //
  1714. // T:System.FormatException:
  1715. // The format specification in format is invalid.
  1716. /// <summary>
  1717. ///
  1718. /// </summary>
  1719. /// <param name="format"></param>
  1720. /// <param name="arg0"></param>
  1721. /// <param name="arg1"></param>
  1722. /// <param name="arg2"></param>
  1723. public static void WriteLine (string format, object arg0, object arg1, object arg2)
  1724. {
  1725. throw new NotImplementedException ();
  1726. }
  1727. //[CLSCompliant (false)]
  1728. /// <summary>
  1729. ///
  1730. /// </summary>
  1731. /// <param name="format"></param>
  1732. /// <param name="arg0"></param>
  1733. /// <param name="arg1"></param>
  1734. /// <param name="arg2"></param>
  1735. /// <param name="arg3"></param>
  1736. public static void WriteLine (string format, object arg0, object arg1, object arg2, object arg3)
  1737. {
  1738. throw new NotImplementedException ();
  1739. }
  1740. //
  1741. // Summary:
  1742. // Writes the text representation of the specified array of objects, followed by
  1743. // the current line terminator, to the standard output stream using the specified
  1744. // format information.
  1745. //
  1746. // Parameters:
  1747. // format:
  1748. // A composite format string (see Remarks).
  1749. //
  1750. // arg:
  1751. // An array of objects to write using format.
  1752. //
  1753. // Exceptions:
  1754. // T:System.IO.IOException:
  1755. // An I/O error occurred.
  1756. //
  1757. // T:System.ArgumentNullException:
  1758. // format or arg is null.
  1759. //
  1760. // T:System.FormatException:
  1761. // The format specification in format is invalid.
  1762. /// <summary>
  1763. ///
  1764. /// </summary>
  1765. /// <param name="format"></param>
  1766. /// <param name="arg"></param>
  1767. public static void WriteLine (string format, params object [] arg)
  1768. {
  1769. throw new NotImplementedException ();
  1770. }
  1771. //
  1772. // Summary:
  1773. // Writes the specified subarray of Unicode characters, followed by the current
  1774. // line terminator, to the standard output stream.
  1775. //
  1776. // Parameters:
  1777. // buffer:
  1778. // An array of Unicode characters.
  1779. //
  1780. // index:
  1781. // The starting position in buffer.
  1782. //
  1783. // count:
  1784. // The number of characters to write.
  1785. //
  1786. // Exceptions:
  1787. // T:System.ArgumentNullException:
  1788. // buffer is null.
  1789. //
  1790. // T:System.ArgumentOutOfRangeException:
  1791. // index or count is less than zero.
  1792. //
  1793. // T:System.ArgumentException:
  1794. // index plus count specify a position that is not within buffer.
  1795. //
  1796. // T:System.IO.IOException:
  1797. // An I/O error occurred.
  1798. /// <summary>
  1799. ///
  1800. /// </summary>
  1801. /// <param name="buffer"></param>
  1802. /// <param name="index"></param>
  1803. /// <param name="count"></param>
  1804. public static void WriteLine (char [] buffer, int index, int count)
  1805. {
  1806. throw new NotImplementedException ();
  1807. }
  1808. //
  1809. // Summary:
  1810. // Writes the text representation of the specified System.Decimal value, followed
  1811. // by the current line terminator, to the standard output stream.
  1812. //
  1813. // Parameters:
  1814. // value:
  1815. // The value to write.
  1816. //
  1817. // Exceptions:
  1818. // T:System.IO.IOException:
  1819. // An I/O error occurred.
  1820. /// <summary>
  1821. ///
  1822. /// </summary>
  1823. /// <param name="value"></param>
  1824. public static void WriteLine (decimal value)
  1825. {
  1826. throw new NotImplementedException ();
  1827. }
  1828. //
  1829. // Summary:
  1830. // Writes the specified array of Unicode characters, followed by the current line
  1831. // terminator, to the standard output stream.
  1832. //
  1833. // Parameters:
  1834. // buffer:
  1835. // A Unicode character array.
  1836. //
  1837. // Exceptions:
  1838. // T:System.IO.IOException:
  1839. // An I/O error occurred.
  1840. /// <summary>
  1841. ///
  1842. /// </summary>
  1843. /// <param name="buffer"></param>
  1844. public static void WriteLine (char [] buffer)
  1845. {
  1846. throw new NotImplementedException ();
  1847. }
  1848. //
  1849. // Summary:
  1850. // Writes the specified Unicode character, followed by the current line terminator,
  1851. // value to the standard output stream.
  1852. //
  1853. // Parameters:
  1854. // value:
  1855. // The value to write.
  1856. //
  1857. // Exceptions:
  1858. // T:System.IO.IOException:
  1859. // An I/O error occurred.
  1860. /// <summary>
  1861. ///
  1862. /// </summary>
  1863. /// <param name="value"></param>
  1864. public static void WriteLine (char value)
  1865. {
  1866. throw new NotImplementedException ();
  1867. }
  1868. //
  1869. // Summary:
  1870. // Writes the text representation of the specified Boolean value, followed by the
  1871. // current line terminator, to the standard output stream.
  1872. //
  1873. // Parameters:
  1874. // value:
  1875. // The value to write.
  1876. //
  1877. // Exceptions:
  1878. // T:System.IO.IOException:
  1879. // An I/O error occurred.
  1880. /// <summary>
  1881. ///
  1882. /// </summary>
  1883. /// <param name="value"></param>
  1884. public static void WriteLine (bool value)
  1885. {
  1886. throw new NotImplementedException ();
  1887. }
  1888. //
  1889. // Summary:
  1890. // Writes the text representation of the specified objects, followed by the current
  1891. // line terminator, to the standard output stream using the specified format information.
  1892. //
  1893. // Parameters:
  1894. // format:
  1895. // A composite format string (see Remarks).
  1896. //
  1897. // arg0:
  1898. // The first object to write using format.
  1899. //
  1900. // arg1:
  1901. // The second object to write using format.
  1902. //
  1903. // Exceptions:
  1904. // T:System.IO.IOException:
  1905. // An I/O error occurred.
  1906. //
  1907. // T:System.ArgumentNullException:
  1908. // format is null.
  1909. //
  1910. // T:System.FormatException:
  1911. // The format specification in format is invalid.
  1912. /// <summary>
  1913. ///
  1914. /// </summary>
  1915. /// <param name="format"></param>
  1916. /// <param name="arg0"></param>
  1917. /// <param name="arg1"></param>
  1918. public static void WriteLine (string format, object arg0, object arg1)
  1919. {
  1920. throw new NotImplementedException ();
  1921. }
  1922. //
  1923. // Summary:
  1924. // Writes the text representation of the specified double-precision floating-point
  1925. // value, followed by the current line terminator, to the standard output stream.
  1926. //
  1927. // Parameters:
  1928. // value:
  1929. // The value to write.
  1930. //
  1931. // Exceptions:
  1932. // T:System.IO.IOException:
  1933. // An I/O error occurred.
  1934. /// <summary>
  1935. ///
  1936. /// </summary>
  1937. /// <param name="value"></param>
  1938. public static void WriteLine (double value)
  1939. {
  1940. throw new NotImplementedException ();
  1941. }
  1942. }
  1943. }