Terminal.Gui.StackExtensions.html 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520
  1. <!DOCTYPE html>
  2. <!--[if IE]><![endif]-->
  3. <html>
  4. <head>
  5. <meta charset="utf-8">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  7. <title>Class StackExtensions
  8. </title>
  9. <meta name="viewport" content="width=device-width">
  10. <meta name="title" content="Class StackExtensions
  11. ">
  12. <meta name="generator" content="docfx 2.59.3.0">
  13. <link rel="shortcut icon" href="../../favicon.ico">
  14. <link rel="stylesheet" href="../../styles/docfx.vendor.css">
  15. <link rel="stylesheet" href="../../styles/docfx.css">
  16. <link rel="stylesheet" href="../../styles/main.css">
  17. <link href="https://fonts.googleapis.com/css?family=Source Sans Pro" rel="stylesheet">
  18. <link href="https://fonts.googleapis.com/css?family=Source Code Pro" rel="stylesheet">
  19. <meta property="docfx:navrel" content="../../toc.html">
  20. <meta property="docfx:tocrel" content="toc.html">
  21. <meta property="docfx:rel" content="../../">
  22. </head> <body data-spy="scroll" data-target="#affix" data-offset="120">
  23. <div id="wrapper">
  24. <header>
  25. <nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
  26. <div class="container">
  27. <div class="navbar-header">
  28. <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
  29. <span class="sr-only">Toggle navigation</span>
  30. <span class="icon-bar"></span>
  31. <span class="icon-bar"></span>
  32. <span class="icon-bar"></span>
  33. </button>
  34. <a class="navbar-brand" href="../../index.html">
  35. <img id="logo" class="svg" src="../../images/logo48.png" alt="">
  36. </a>
  37. </div>
  38. <div class="collapse navbar-collapse" id="navbar">
  39. <form class="navbar-form navbar-right" role="search" id="search">
  40. <div class="form-group">
  41. <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
  42. </div>
  43. </form>
  44. </div>
  45. </div>
  46. </nav>
  47. <div class="subnav navbar navbar-default">
  48. <div class="container hide-when-search" id="breadcrumb">
  49. <ul class="breadcrumb">
  50. <li></li>
  51. </ul>
  52. </div>
  53. </div>
  54. </header>
  55. <div class="container body-content">
  56. <div id="search-results">
  57. <div class="search-list">Search Results for <span></span></div>
  58. <div class="sr-items">
  59. <p><i class="glyphicon glyphicon-refresh index-loading"></i></p>
  60. </div>
  61. <ul id="pagination" data-first="First" data-prev="Previous" data-next="Next" data-last="Last"></ul>
  62. </div>
  63. </div>
  64. <div role="main" class="container body-content hide-when-search">
  65. <div class="sidenav hide-when-search">
  66. <a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
  67. <div class="sidetoggle collapse" id="sidetoggle">
  68. <div id="sidetoc"></div>
  69. </div>
  70. </div>
  71. <div class="article row grid-right">
  72. <div class="col-md-10">
  73. <article class="content wrap" id="_content" data-uid="Terminal.Gui.StackExtensions">
  74. <h1 id="Terminal_Gui_StackExtensions" data-uid="Terminal.Gui.StackExtensions" class="text-break">Class StackExtensions
  75. </h1>
  76. <div class="markdown level0 summary">
  77. Extension of <span class="xref">System.Collections.Generic.Stack&lt;&gt;</span> helper to work with specific <span class="xref">System.Collections.Generic.IEqualityComparer&lt;&gt;</span>
  78. </div>
  79. <div class="markdown level0 conceptual"></div>
  80. <div class="inheritance">
  81. <h5>Inheritance</h5>
  82. <div class="level0"><span class="xref">System.Object</span></div>
  83. <div class="level1"><span class="xref">StackExtensions</span></div>
  84. </div>
  85. <h6><strong>Namespace</strong>: <a class="xref" href="Terminal.Gui.html">Terminal.Gui</a></h6>
  86. <h6><strong>Assembly</strong>: Terminal.Gui.dll</h6>
  87. <h5 id="Terminal_Gui_StackExtensions_syntax">Syntax</h5>
  88. <div class="codewrapper">
  89. <pre><code class="lang-csharp hljs">public static class StackExtensions : Object</code></pre>
  90. </div>
  91. <h3 id="methods">Methods
  92. </h3>
  93. <a id="Terminal_Gui_StackExtensions_Contains_" data-uid="Terminal.Gui.StackExtensions.Contains*"></a>
  94. <h4 id="Terminal_Gui_StackExtensions_Contains__1_System_Collections_Generic_Stack___0____0_System_Collections_Generic_IEqualityComparer___0__" data-uid="Terminal.Gui.StackExtensions.Contains``1(System.Collections.Generic.Stack{``0},``0,System.Collections.Generic.IEqualityComparer{``0})">Contains&lt;T&gt;(Stack&lt;T&gt;, T, IEqualityComparer&lt;T&gt;)</h4>
  95. <div class="markdown level1 summary">
  96. Check if the stack object contains the value to find.
  97. </div>
  98. <div class="markdown level1 conceptual"></div>
  99. <h5 class="decalaration">Declaration</h5>
  100. <div class="codewrapper">
  101. <pre><code class="lang-csharp hljs">public static bool Contains&lt;T&gt;(this Stack&lt;T&gt; stack, T valueToFind, IEqualityComparer&lt;T&gt; comparer = null)</code></pre>
  102. </div>
  103. <h5 class="parameters">Parameters</h5>
  104. <table class="table table-bordered table-striped table-condensed">
  105. <thead>
  106. <tr>
  107. <th>Type</th>
  108. <th>Name</th>
  109. <th>Description</th>
  110. </tr>
  111. </thead>
  112. <tbody>
  113. <tr>
  114. <td><span class="xref">System.Collections.Generic.Stack</span>&lt;T&gt;</td>
  115. <td><span class="parametername">stack</span></td>
  116. <td>The stack object.</td>
  117. </tr>
  118. <tr>
  119. <td><span class="xref">T</span></td>
  120. <td><span class="parametername">valueToFind</span></td>
  121. <td>Value to find.</td>
  122. </tr>
  123. <tr>
  124. <td><span class="xref">System.Collections.Generic.IEqualityComparer</span>&lt;T&gt;</td>
  125. <td><span class="parametername">comparer</span></td>
  126. <td>The comparison object.</td>
  127. </tr>
  128. </tbody>
  129. </table>
  130. <h5 class="returns">Returns</h5>
  131. <table class="table table-bordered table-striped table-condensed">
  132. <thead>
  133. <tr>
  134. <th>Type</th>
  135. <th>Description</th>
  136. </tr>
  137. </thead>
  138. <tbody>
  139. <tr>
  140. <td><span class="xref">System.Boolean</span></td>
  141. <td><code>true</code> If the value was found.<code>false</code> otherwise.</td>
  142. </tr>
  143. </tbody>
  144. </table>
  145. <h5 class="typeParameters">Type Parameters</h5>
  146. <table class="table table-bordered table-striped table-condensed">
  147. <thead>
  148. <tr>
  149. <th>Name</th>
  150. <th>Description</th>
  151. </tr>
  152. </thead>
  153. <tbody>
  154. <tr>
  155. <td><span class="parametername">T</span></td>
  156. <td>The stack object type.</td>
  157. </tr>
  158. </tbody>
  159. </table>
  160. <a id="Terminal_Gui_StackExtensions_FindDuplicates_" data-uid="Terminal.Gui.StackExtensions.FindDuplicates*"></a>
  161. <h4 id="Terminal_Gui_StackExtensions_FindDuplicates__1_System_Collections_Generic_Stack___0__System_Collections_Generic_IEqualityComparer___0__" data-uid="Terminal.Gui.StackExtensions.FindDuplicates``1(System.Collections.Generic.Stack{``0},System.Collections.Generic.IEqualityComparer{``0})">FindDuplicates&lt;T&gt;(Stack&lt;T&gt;, IEqualityComparer&lt;T&gt;)</h4>
  162. <div class="markdown level1 summary">
  163. Find all duplicates stack objects values.
  164. </div>
  165. <div class="markdown level1 conceptual"></div>
  166. <h5 class="decalaration">Declaration</h5>
  167. <div class="codewrapper">
  168. <pre><code class="lang-csharp hljs">public static Stack&lt;T&gt; FindDuplicates&lt;T&gt;(this Stack&lt;T&gt; stack, IEqualityComparer&lt;T&gt; comparer = null)</code></pre>
  169. </div>
  170. <h5 class="parameters">Parameters</h5>
  171. <table class="table table-bordered table-striped table-condensed">
  172. <thead>
  173. <tr>
  174. <th>Type</th>
  175. <th>Name</th>
  176. <th>Description</th>
  177. </tr>
  178. </thead>
  179. <tbody>
  180. <tr>
  181. <td><span class="xref">System.Collections.Generic.Stack</span>&lt;T&gt;</td>
  182. <td><span class="parametername">stack</span></td>
  183. <td>The stack object.</td>
  184. </tr>
  185. <tr>
  186. <td><span class="xref">System.Collections.Generic.IEqualityComparer</span>&lt;T&gt;</td>
  187. <td><span class="parametername">comparer</span></td>
  188. <td>The comparison object.</td>
  189. </tr>
  190. </tbody>
  191. </table>
  192. <h5 class="returns">Returns</h5>
  193. <table class="table table-bordered table-striped table-condensed">
  194. <thead>
  195. <tr>
  196. <th>Type</th>
  197. <th>Description</th>
  198. </tr>
  199. </thead>
  200. <tbody>
  201. <tr>
  202. <td><span class="xref">System.Collections.Generic.Stack</span>&lt;T&gt;</td>
  203. <td>The duplicates stack object.</td>
  204. </tr>
  205. </tbody>
  206. </table>
  207. <h5 class="typeParameters">Type Parameters</h5>
  208. <table class="table table-bordered table-striped table-condensed">
  209. <thead>
  210. <tr>
  211. <th>Name</th>
  212. <th>Description</th>
  213. </tr>
  214. </thead>
  215. <tbody>
  216. <tr>
  217. <td><span class="parametername">T</span></td>
  218. <td>The stack object type.</td>
  219. </tr>
  220. </tbody>
  221. </table>
  222. <a id="Terminal_Gui_StackExtensions_MoveNext_" data-uid="Terminal.Gui.StackExtensions.MoveNext*"></a>
  223. <h4 id="Terminal_Gui_StackExtensions_MoveNext__1_System_Collections_Generic_Stack___0__" data-uid="Terminal.Gui.StackExtensions.MoveNext``1(System.Collections.Generic.Stack{``0})">MoveNext&lt;T&gt;(Stack&lt;T&gt;)</h4>
  224. <div class="markdown level1 summary">
  225. Move the first stack object value to the end.
  226. </div>
  227. <div class="markdown level1 conceptual"></div>
  228. <h5 class="decalaration">Declaration</h5>
  229. <div class="codewrapper">
  230. <pre><code class="lang-csharp hljs">public static void MoveNext&lt;T&gt;(this Stack&lt;T&gt; stack)</code></pre>
  231. </div>
  232. <h5 class="parameters">Parameters</h5>
  233. <table class="table table-bordered table-striped table-condensed">
  234. <thead>
  235. <tr>
  236. <th>Type</th>
  237. <th>Name</th>
  238. <th>Description</th>
  239. </tr>
  240. </thead>
  241. <tbody>
  242. <tr>
  243. <td><span class="xref">System.Collections.Generic.Stack</span>&lt;T&gt;</td>
  244. <td><span class="parametername">stack</span></td>
  245. <td>The stack object.</td>
  246. </tr>
  247. </tbody>
  248. </table>
  249. <h5 class="typeParameters">Type Parameters</h5>
  250. <table class="table table-bordered table-striped table-condensed">
  251. <thead>
  252. <tr>
  253. <th>Name</th>
  254. <th>Description</th>
  255. </tr>
  256. </thead>
  257. <tbody>
  258. <tr>
  259. <td><span class="parametername">T</span></td>
  260. <td>The stack object type.</td>
  261. </tr>
  262. </tbody>
  263. </table>
  264. <a id="Terminal_Gui_StackExtensions_MovePrevious_" data-uid="Terminal.Gui.StackExtensions.MovePrevious*"></a>
  265. <h4 id="Terminal_Gui_StackExtensions_MovePrevious__1_System_Collections_Generic_Stack___0__" data-uid="Terminal.Gui.StackExtensions.MovePrevious``1(System.Collections.Generic.Stack{``0})">MovePrevious&lt;T&gt;(Stack&lt;T&gt;)</h4>
  266. <div class="markdown level1 summary">
  267. Move the last stack object value to the top.
  268. </div>
  269. <div class="markdown level1 conceptual"></div>
  270. <h5 class="decalaration">Declaration</h5>
  271. <div class="codewrapper">
  272. <pre><code class="lang-csharp hljs">public static void MovePrevious&lt;T&gt;(this Stack&lt;T&gt; stack)</code></pre>
  273. </div>
  274. <h5 class="parameters">Parameters</h5>
  275. <table class="table table-bordered table-striped table-condensed">
  276. <thead>
  277. <tr>
  278. <th>Type</th>
  279. <th>Name</th>
  280. <th>Description</th>
  281. </tr>
  282. </thead>
  283. <tbody>
  284. <tr>
  285. <td><span class="xref">System.Collections.Generic.Stack</span>&lt;T&gt;</td>
  286. <td><span class="parametername">stack</span></td>
  287. <td>The stack object.</td>
  288. </tr>
  289. </tbody>
  290. </table>
  291. <h5 class="typeParameters">Type Parameters</h5>
  292. <table class="table table-bordered table-striped table-condensed">
  293. <thead>
  294. <tr>
  295. <th>Name</th>
  296. <th>Description</th>
  297. </tr>
  298. </thead>
  299. <tbody>
  300. <tr>
  301. <td><span class="parametername">T</span></td>
  302. <td>The stack object type.</td>
  303. </tr>
  304. </tbody>
  305. </table>
  306. <a id="Terminal_Gui_StackExtensions_MoveTo_" data-uid="Terminal.Gui.StackExtensions.MoveTo*"></a>
  307. <h4 id="Terminal_Gui_StackExtensions_MoveTo__1_System_Collections_Generic_Stack___0____0_System_Int32_System_Collections_Generic_IEqualityComparer___0__" data-uid="Terminal.Gui.StackExtensions.MoveTo``1(System.Collections.Generic.Stack{``0},``0,System.Int32,System.Collections.Generic.IEqualityComparer{``0})">MoveTo&lt;T&gt;(Stack&lt;T&gt;, T, Int32, IEqualityComparer&lt;T&gt;)</h4>
  308. <div class="markdown level1 summary">
  309. Move the stack object value to the index.
  310. </div>
  311. <div class="markdown level1 conceptual"></div>
  312. <h5 class="decalaration">Declaration</h5>
  313. <div class="codewrapper">
  314. <pre><code class="lang-csharp hljs">public static void MoveTo&lt;T&gt;(this Stack&lt;T&gt; stack, T valueToMove, int index = 0, IEqualityComparer&lt;T&gt; comparer = null)</code></pre>
  315. </div>
  316. <h5 class="parameters">Parameters</h5>
  317. <table class="table table-bordered table-striped table-condensed">
  318. <thead>
  319. <tr>
  320. <th>Type</th>
  321. <th>Name</th>
  322. <th>Description</th>
  323. </tr>
  324. </thead>
  325. <tbody>
  326. <tr>
  327. <td><span class="xref">System.Collections.Generic.Stack</span>&lt;T&gt;</td>
  328. <td><span class="parametername">stack</span></td>
  329. <td>The stack object.</td>
  330. </tr>
  331. <tr>
  332. <td><span class="xref">T</span></td>
  333. <td><span class="parametername">valueToMove</span></td>
  334. <td>Value to move.</td>
  335. </tr>
  336. <tr>
  337. <td><span class="xref">System.Int32</span></td>
  338. <td><span class="parametername">index</span></td>
  339. <td>The index where to move.</td>
  340. </tr>
  341. <tr>
  342. <td><span class="xref">System.Collections.Generic.IEqualityComparer</span>&lt;T&gt;</td>
  343. <td><span class="parametername">comparer</span></td>
  344. <td>The comparison object.</td>
  345. </tr>
  346. </tbody>
  347. </table>
  348. <h5 class="typeParameters">Type Parameters</h5>
  349. <table class="table table-bordered table-striped table-condensed">
  350. <thead>
  351. <tr>
  352. <th>Name</th>
  353. <th>Description</th>
  354. </tr>
  355. </thead>
  356. <tbody>
  357. <tr>
  358. <td><span class="parametername">T</span></td>
  359. <td>The stack object type.</td>
  360. </tr>
  361. </tbody>
  362. </table>
  363. <a id="Terminal_Gui_StackExtensions_Replace_" data-uid="Terminal.Gui.StackExtensions.Replace*"></a>
  364. <h4 id="Terminal_Gui_StackExtensions_Replace__1_System_Collections_Generic_Stack___0____0___0_System_Collections_Generic_IEqualityComparer___0__" data-uid="Terminal.Gui.StackExtensions.Replace``1(System.Collections.Generic.Stack{``0},``0,``0,System.Collections.Generic.IEqualityComparer{``0})">Replace&lt;T&gt;(Stack&lt;T&gt;, T, T, IEqualityComparer&lt;T&gt;)</h4>
  365. <div class="markdown level1 summary">
  366. Replaces an stack object values that match with the value to replace.
  367. </div>
  368. <div class="markdown level1 conceptual"></div>
  369. <h5 class="decalaration">Declaration</h5>
  370. <div class="codewrapper">
  371. <pre><code class="lang-csharp hljs">public static void Replace&lt;T&gt;(this Stack&lt;T&gt; stack, T valueToReplace, T valueToReplaceWith, IEqualityComparer&lt;T&gt; comparer = null)</code></pre>
  372. </div>
  373. <h5 class="parameters">Parameters</h5>
  374. <table class="table table-bordered table-striped table-condensed">
  375. <thead>
  376. <tr>
  377. <th>Type</th>
  378. <th>Name</th>
  379. <th>Description</th>
  380. </tr>
  381. </thead>
  382. <tbody>
  383. <tr>
  384. <td><span class="xref">System.Collections.Generic.Stack</span>&lt;T&gt;</td>
  385. <td><span class="parametername">stack</span></td>
  386. <td>The stack object.</td>
  387. </tr>
  388. <tr>
  389. <td><span class="xref">T</span></td>
  390. <td><span class="parametername">valueToReplace</span></td>
  391. <td>Value to replace.</td>
  392. </tr>
  393. <tr>
  394. <td><span class="xref">T</span></td>
  395. <td><span class="parametername">valueToReplaceWith</span></td>
  396. <td>Value to replace with to what matches the value to replace.</td>
  397. </tr>
  398. <tr>
  399. <td><span class="xref">System.Collections.Generic.IEqualityComparer</span>&lt;T&gt;</td>
  400. <td><span class="parametername">comparer</span></td>
  401. <td>The comparison object.</td>
  402. </tr>
  403. </tbody>
  404. </table>
  405. <h5 class="typeParameters">Type Parameters</h5>
  406. <table class="table table-bordered table-striped table-condensed">
  407. <thead>
  408. <tr>
  409. <th>Name</th>
  410. <th>Description</th>
  411. </tr>
  412. </thead>
  413. <tbody>
  414. <tr>
  415. <td><span class="parametername">T</span></td>
  416. <td>The stack object type.</td>
  417. </tr>
  418. </tbody>
  419. </table>
  420. <a id="Terminal_Gui_StackExtensions_Swap_" data-uid="Terminal.Gui.StackExtensions.Swap*"></a>
  421. <h4 id="Terminal_Gui_StackExtensions_Swap__1_System_Collections_Generic_Stack___0____0___0_System_Collections_Generic_IEqualityComparer___0__" data-uid="Terminal.Gui.StackExtensions.Swap``1(System.Collections.Generic.Stack{``0},``0,``0,System.Collections.Generic.IEqualityComparer{``0})">Swap&lt;T&gt;(Stack&lt;T&gt;, T, T, IEqualityComparer&lt;T&gt;)</h4>
  422. <div class="markdown level1 summary">
  423. Swap two stack objects values that matches with the both values.
  424. </div>
  425. <div class="markdown level1 conceptual"></div>
  426. <h5 class="decalaration">Declaration</h5>
  427. <div class="codewrapper">
  428. <pre><code class="lang-csharp hljs">public static void Swap&lt;T&gt;(this Stack&lt;T&gt; stack, T valueToSwapFrom, T valueToSwapTo, IEqualityComparer&lt;T&gt; comparer = null)</code></pre>
  429. </div>
  430. <h5 class="parameters">Parameters</h5>
  431. <table class="table table-bordered table-striped table-condensed">
  432. <thead>
  433. <tr>
  434. <th>Type</th>
  435. <th>Name</th>
  436. <th>Description</th>
  437. </tr>
  438. </thead>
  439. <tbody>
  440. <tr>
  441. <td><span class="xref">System.Collections.Generic.Stack</span>&lt;T&gt;</td>
  442. <td><span class="parametername">stack</span></td>
  443. <td>The stack object.</td>
  444. </tr>
  445. <tr>
  446. <td><span class="xref">T</span></td>
  447. <td><span class="parametername">valueToSwapFrom</span></td>
  448. <td>Value to swap from.</td>
  449. </tr>
  450. <tr>
  451. <td><span class="xref">T</span></td>
  452. <td><span class="parametername">valueToSwapTo</span></td>
  453. <td>Value to swap to.</td>
  454. </tr>
  455. <tr>
  456. <td><span class="xref">System.Collections.Generic.IEqualityComparer</span>&lt;T&gt;</td>
  457. <td><span class="parametername">comparer</span></td>
  458. <td>The comparison object.</td>
  459. </tr>
  460. </tbody>
  461. </table>
  462. <h5 class="typeParameters">Type Parameters</h5>
  463. <table class="table table-bordered table-striped table-condensed">
  464. <thead>
  465. <tr>
  466. <th>Name</th>
  467. <th>Description</th>
  468. </tr>
  469. </thead>
  470. <tbody>
  471. <tr>
  472. <td><span class="parametername">T</span></td>
  473. <td>The stack object type.</td>
  474. </tr>
  475. </tbody>
  476. </table>
  477. </article>
  478. </div>
  479. <div class="hidden-sm col-md-2" role="complementary">
  480. <div class="sideaffix">
  481. <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
  482. <h5>In This Article</h5>
  483. <div></div>
  484. </nav>
  485. </div>
  486. </div>
  487. </div>
  488. </div>
  489. <footer>
  490. <div class="grad-bottom"></div>
  491. <div class="footer">
  492. <div class="container">
  493. <span class="pull-right">
  494. <a href="#top">Back to top</a>
  495. </span>
  496. <span>Generated by <strong>DocFX</strong></span>
  497. </div>
  498. </div>
  499. </footer>
  500. </div>
  501. <script type="text/javascript" src="../../styles/docfx.vendor.js"></script>
  502. <script type="text/javascript" src="../../styles/docfx.js"></script>
  503. <script type="text/javascript" src="../../styles/main.js"></script>
  504. </body>
  505. </html>