Terminal.Gui.IListDataSource.html 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384
  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>Interface IListDataSource
  8. </title>
  9. <meta name="viewport" content="width=device-width">
  10. <meta name="title" content="Interface IListDataSource
  11. ">
  12. <link rel="shortcut icon" href="../../favicon.ico">
  13. <link rel="stylesheet" href="../../styles/docfx.vendor.min.css">
  14. <link rel="stylesheet" href="../../styles/docfx.css">
  15. <link rel="stylesheet" href="../../styles/main.css">
  16. <meta property="docfx:navrel" content="../../toc.html">
  17. <meta property="docfx:tocrel" content="toc.html">
  18. <meta property="docfx:rel" content="../../">
  19. </head>
  20. <body data-spy="scroll" data-target="#affix" data-offset="120">
  21. <div id="wrapper">
  22. <header>
  23. <nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
  24. <div class="container">
  25. <div class="navbar-header">
  26. <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
  27. <span class="sr-only">Toggle navigation</span>
  28. <span class="icon-bar"></span>
  29. <span class="icon-bar"></span>
  30. <span class="icon-bar"></span>
  31. </button>
  32. <a class="navbar-brand" href="../../index.html">
  33. <img id="logo" class="svg" src="../../images/logo48.png" alt="">
  34. </a>
  35. </div>
  36. <div class="collapse navbar-collapse" id="navbar">
  37. <form class="navbar-form navbar-right" role="search" id="search">
  38. <div class="form-group">
  39. <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
  40. </div>
  41. </form>
  42. </div>
  43. </div>
  44. </nav>
  45. <div class="subnav navbar navbar-default">
  46. <div class="container hide-when-search" id="breadcrumb">
  47. <ul class="breadcrumb">
  48. <li></li>
  49. </ul>
  50. </div>
  51. </div>
  52. </header>
  53. <div class="container body-content">
  54. <div id="search-results">
  55. <div class="search-list">Search Results for <span></span></div>
  56. <div class="sr-items">
  57. <p><i class="glyphicon glyphicon-refresh index-loading"></i></p>
  58. </div>
  59. <ul id="pagination" data-first="First" data-prev="Previous" data-next="Next" data-last="Last"></ul>
  60. </div>
  61. </div>
  62. <div role="main" class="container body-content hide-when-search">
  63. <div class="sidenav hide-when-search">
  64. <a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
  65. <div class="sidetoggle collapse" id="sidetoggle">
  66. <div id="sidetoc"></div>
  67. </div>
  68. </div>
  69. <div class="article row grid-right">
  70. <div class="col-md-10">
  71. <article class="content wrap" id="_content" data-uid="Terminal.Gui.IListDataSource">
  72. <h1 id="Terminal_Gui_IListDataSource" data-uid="Terminal.Gui.IListDataSource" class="text-break">Interface IListDataSource
  73. </h1>
  74. <div class="markdown level0 summary">Implement <a class="xref" href="Terminal.Gui.IListDataSource.html">IListDataSource</a> to provide custom rendering for a <a class="xref" href="Terminal.Gui.ListView.html">ListView</a>.</div>
  75. <div class="markdown level0 conceptual"></div>
  76. <h6><strong>Namespace</strong>: <a class="xref" href="Terminal.html">Terminal</a>.<a class="xref" href="Terminal.Gui.html">Gui</a></h6>
  77. <h6><strong>Assembly</strong>: Terminal.Gui.dll</h6>
  78. <h5 id="Terminal_Gui_IListDataSource_syntax">Syntax</h5>
  79. <div class="codewrapper">
  80. <pre><code class="lang-csharp hljs">public interface IListDataSource</code></pre>
  81. </div>
  82. <h3 id="properties">Properties
  83. </h3>
  84. <span class="small pull-right mobile-hide">
  85. <span class="divider">|</span>
  86. <a href="https://github.com/gui-cs/Terminal.Gui/new/develop/docfx/overrides/new?filename=Terminal_Gui_IListDataSource_Count.md&amp;value=---%0Auid%3A%20Terminal.Gui.IListDataSource.Count%0Asummary%3A%20&#39;*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax&#39;%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Edit this page</a>
  87. </span>
  88. <span class="small pull-right mobile-hide">
  89. <a href="tig:tig/Terminal.Gui/blob/v2_develop/Terminal.Gui/Views/ListView.cs/#L17">View Source</a>
  90. </span>
  91. <a id="Terminal_Gui_IListDataSource_Count_" data-uid="Terminal.Gui.IListDataSource.Count*"></a>
  92. <h4 id="Terminal_Gui_IListDataSource_Count" data-uid="Terminal.Gui.IListDataSource.Count">Count</h4>
  93. <div class="markdown level1 summary">Returns the number of elements to display</div>
  94. <div class="markdown level1 conceptual"></div>
  95. <h5 class="declaration">Declaration</h5>
  96. <div class="codewrapper">
  97. <pre><code class="lang-csharp hljs">int Count { get; }</code></pre>
  98. </div>
  99. <h5 class="propertyValue">Property Value</h5>
  100. <table class="table table-bordered table-condensed">
  101. <thead>
  102. <tr>
  103. <th>Type</th>
  104. <th>Description</th>
  105. </tr>
  106. </thead>
  107. <tbody>
  108. <tr>
  109. <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
  110. <td></td>
  111. </tr>
  112. </tbody>
  113. </table>
  114. <span class="small pull-right mobile-hide">
  115. <span class="divider">|</span>
  116. <a href="https://github.com/gui-cs/Terminal.Gui/new/develop/docfx/overrides/new?filename=Terminal_Gui_IListDataSource_Length.md&amp;value=---%0Auid%3A%20Terminal.Gui.IListDataSource.Length%0Asummary%3A%20&#39;*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax&#39;%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Edit this page</a>
  117. </span>
  118. <span class="small pull-right mobile-hide">
  119. <a href="tig:tig/Terminal.Gui/blob/v2_develop/Terminal.Gui/Views/ListView.cs/#L22">View Source</a>
  120. </span>
  121. <a id="Terminal_Gui_IListDataSource_Length_" data-uid="Terminal.Gui.IListDataSource.Length*"></a>
  122. <h4 id="Terminal_Gui_IListDataSource_Length" data-uid="Terminal.Gui.IListDataSource.Length">Length</h4>
  123. <div class="markdown level1 summary">Returns the maximum length of elements to display</div>
  124. <div class="markdown level1 conceptual"></div>
  125. <h5 class="declaration">Declaration</h5>
  126. <div class="codewrapper">
  127. <pre><code class="lang-csharp hljs">int Length { get; }</code></pre>
  128. </div>
  129. <h5 class="propertyValue">Property Value</h5>
  130. <table class="table table-bordered table-condensed">
  131. <thead>
  132. <tr>
  133. <th>Type</th>
  134. <th>Description</th>
  135. </tr>
  136. </thead>
  137. <tbody>
  138. <tr>
  139. <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
  140. <td></td>
  141. </tr>
  142. </tbody>
  143. </table>
  144. <h3 id="methods">Methods
  145. </h3>
  146. <span class="small pull-right mobile-hide">
  147. <span class="divider">|</span>
  148. <a href="https://github.com/gui-cs/Terminal.Gui/new/develop/docfx/overrides/new?filename=Terminal_Gui_IListDataSource_IsMarked_System_Int32_.md&amp;value=---%0Auid%3A%20Terminal.Gui.IListDataSource.IsMarked(System.Int32)%0Asummary%3A%20&#39;*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax&#39;%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Edit this page</a>
  149. </span>
  150. <span class="small pull-right mobile-hide">
  151. <a href="tig:tig/Terminal.Gui/blob/v2_develop/Terminal.Gui/Views/ListView.cs/#L46">View Source</a>
  152. </span>
  153. <a id="Terminal_Gui_IListDataSource_IsMarked_" data-uid="Terminal.Gui.IListDataSource.IsMarked*"></a>
  154. <h4 id="Terminal_Gui_IListDataSource_IsMarked_System_Int32_" data-uid="Terminal.Gui.IListDataSource.IsMarked(System.Int32)">IsMarked(int)</h4>
  155. <div class="markdown level1 summary">Should return whether the specified item is currently marked.</div>
  156. <div class="markdown level1 conceptual"></div>
  157. <h5 class="declaration">Declaration</h5>
  158. <div class="codewrapper">
  159. <pre><code class="lang-csharp hljs">bool IsMarked(int item)</code></pre>
  160. </div>
  161. <h5 class="parameters">Parameters</h5>
  162. <table class="table table-bordered table-condensed">
  163. <thead>
  164. <tr>
  165. <th>Type</th>
  166. <th>Name</th>
  167. <th>Description</th>
  168. </tr>
  169. </thead>
  170. <tbody>
  171. <tr>
  172. <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
  173. <td><span class="parametername">item</span></td>
  174. <td>Item index.</td>
  175. </tr>
  176. </tbody>
  177. </table>
  178. <h5 class="returns">Returns</h5>
  179. <table class="table table-bordered table-condensed">
  180. <thead>
  181. <tr>
  182. <th>Type</th>
  183. <th>Description</th>
  184. </tr>
  185. </thead>
  186. <tbody>
  187. <tr>
  188. <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
  189. <td><a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">true</a>, if marked, <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">false</a> otherwise.</td>
  190. </tr>
  191. </tbody>
  192. </table>
  193. <span class="small pull-right mobile-hide">
  194. <span class="divider">|</span>
  195. <a href="https://github.com/gui-cs/Terminal.Gui/new/develop/docfx/overrides/new?filename=Terminal_Gui_IListDataSource_Render_Terminal_Gui_ListView_Terminal_Gui_ConsoleDriver_System_Boolean_System_Int32_System_Int32_System_Int32_System_Int32_System_Int32_.md&amp;value=---%0Auid%3A%20Terminal.Gui.IListDataSource.Render(Terminal.Gui.ListView%2CTerminal.Gui.ConsoleDriver%2CSystem.Boolean%2CSystem.Int32%2CSystem.Int32%2CSystem.Int32%2CSystem.Int32%2CSystem.Int32)%0Asummary%3A%20&#39;*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax&#39;%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Edit this page</a>
  196. </span>
  197. <span class="small pull-right mobile-hide">
  198. <a href="tig:tig/Terminal.Gui/blob/v2_develop/Terminal.Gui/Views/ListView.cs/#L39">View Source</a>
  199. </span>
  200. <a id="Terminal_Gui_IListDataSource_Render_" data-uid="Terminal.Gui.IListDataSource.Render*"></a>
  201. <h4 id="Terminal_Gui_IListDataSource_Render_Terminal_Gui_ListView_Terminal_Gui_ConsoleDriver_System_Boolean_System_Int32_System_Int32_System_Int32_System_Int32_System_Int32_" data-uid="Terminal.Gui.IListDataSource.Render(Terminal.Gui.ListView,Terminal.Gui.ConsoleDriver,System.Boolean,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32)">Render(ListView, ConsoleDriver, bool, int, int, int, int, int)</h4>
  202. <div class="markdown level1 summary">This method is invoked to render a specified item, the method should cover the entire provided width.</div>
  203. <div class="markdown level1 conceptual"></div>
  204. <h5 class="declaration">Declaration</h5>
  205. <div class="codewrapper">
  206. <pre><code class="lang-csharp hljs">void Render(ListView container, ConsoleDriver driver, bool selected, int item, int col, int line, int width, int start = 0)</code></pre>
  207. </div>
  208. <h5 class="parameters">Parameters</h5>
  209. <table class="table table-bordered table-condensed">
  210. <thead>
  211. <tr>
  212. <th>Type</th>
  213. <th>Name</th>
  214. <th>Description</th>
  215. </tr>
  216. </thead>
  217. <tbody>
  218. <tr>
  219. <td><a class="xref" href="Terminal.Gui.ListView.html">ListView</a></td>
  220. <td><span class="parametername">container</span></td>
  221. <td>The list view to render.</td>
  222. </tr>
  223. <tr>
  224. <td><a class="xref" href="Terminal.Gui.ConsoleDriver.html">ConsoleDriver</a></td>
  225. <td><span class="parametername">driver</span></td>
  226. <td>The console driver to render.</td>
  227. </tr>
  228. <tr>
  229. <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
  230. <td><span class="parametername">selected</span></td>
  231. <td>Describes whether the item being rendered is currently selected by the user.</td>
  232. </tr>
  233. <tr>
  234. <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
  235. <td><span class="parametername">item</span></td>
  236. <td>The index of the item to render, zero for the first item and so on.</td>
  237. </tr>
  238. <tr>
  239. <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
  240. <td><span class="parametername">col</span></td>
  241. <td>The column where the rendering will start</td>
  242. </tr>
  243. <tr>
  244. <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
  245. <td><span class="parametername">line</span></td>
  246. <td>The line where the rendering will be done.</td>
  247. </tr>
  248. <tr>
  249. <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
  250. <td><span class="parametername">width</span></td>
  251. <td>The width that must be filled out.</td>
  252. </tr>
  253. <tr>
  254. <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
  255. <td><span class="parametername">start</span></td>
  256. <td>The index of the string to be displayed.</td>
  257. </tr>
  258. </tbody>
  259. </table>
  260. <h5 id="Terminal_Gui_IListDataSource_Render_Terminal_Gui_ListView_Terminal_Gui_ConsoleDriver_System_Boolean_System_Int32_System_Int32_System_Int32_System_Int32_System_Int32__remarks">Remarks</h5>
  261. <div class="markdown level1 remarks">The default color will be set before this method is invoked, and will be based on whether the item is selected or not.</div>
  262. <span class="small pull-right mobile-hide">
  263. <span class="divider">|</span>
  264. <a href="https://github.com/gui-cs/Terminal.Gui/new/develop/docfx/overrides/new?filename=Terminal_Gui_IListDataSource_SetMark_System_Int32_System_Boolean_.md&amp;value=---%0Auid%3A%20Terminal.Gui.IListDataSource.SetMark(System.Int32%2CSystem.Boolean)%0Asummary%3A%20&#39;*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax&#39;%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Edit this page</a>
  265. </span>
  266. <span class="small pull-right mobile-hide">
  267. <a href="tig:tig/Terminal.Gui/blob/v2_develop/Terminal.Gui/Views/ListView.cs/#L53">View Source</a>
  268. </span>
  269. <a id="Terminal_Gui_IListDataSource_SetMark_" data-uid="Terminal.Gui.IListDataSource.SetMark*"></a>
  270. <h4 id="Terminal_Gui_IListDataSource_SetMark_System_Int32_System_Boolean_" data-uid="Terminal.Gui.IListDataSource.SetMark(System.Int32,System.Boolean)">SetMark(int, bool)</h4>
  271. <div class="markdown level1 summary">Flags the item as marked.</div>
  272. <div class="markdown level1 conceptual"></div>
  273. <h5 class="declaration">Declaration</h5>
  274. <div class="codewrapper">
  275. <pre><code class="lang-csharp hljs">void SetMark(int item, bool value)</code></pre>
  276. </div>
  277. <h5 class="parameters">Parameters</h5>
  278. <table class="table table-bordered table-condensed">
  279. <thead>
  280. <tr>
  281. <th>Type</th>
  282. <th>Name</th>
  283. <th>Description</th>
  284. </tr>
  285. </thead>
  286. <tbody>
  287. <tr>
  288. <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
  289. <td><span class="parametername">item</span></td>
  290. <td>Item index.</td>
  291. </tr>
  292. <tr>
  293. <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
  294. <td><span class="parametername">value</span></td>
  295. <td>If set to <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">true</a> value.</td>
  296. </tr>
  297. </tbody>
  298. </table>
  299. <span class="small pull-right mobile-hide">
  300. <span class="divider">|</span>
  301. <a href="https://github.com/gui-cs/Terminal.Gui/new/develop/docfx/overrides/new?filename=Terminal_Gui_IListDataSource_ToList.md&amp;value=---%0Auid%3A%20Terminal.Gui.IListDataSource.ToList%0Asummary%3A%20&#39;*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax&#39;%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Edit this page</a>
  302. </span>
  303. <span class="small pull-right mobile-hide">
  304. <a href="tig:tig/Terminal.Gui/blob/v2_develop/Terminal.Gui/Views/ListView.cs/#L59">View Source</a>
  305. </span>
  306. <a id="Terminal_Gui_IListDataSource_ToList_" data-uid="Terminal.Gui.IListDataSource.ToList*"></a>
  307. <h4 id="Terminal_Gui_IListDataSource_ToList" data-uid="Terminal.Gui.IListDataSource.ToList">ToList()</h4>
  308. <div class="markdown level1 summary">Return the source as IList.</div>
  309. <div class="markdown level1 conceptual"></div>
  310. <h5 class="declaration">Declaration</h5>
  311. <div class="codewrapper">
  312. <pre><code class="lang-csharp hljs">IList ToList()</code></pre>
  313. </div>
  314. <h5 class="returns">Returns</h5>
  315. <table class="table table-bordered table-condensed">
  316. <thead>
  317. <tr>
  318. <th>Type</th>
  319. <th>Description</th>
  320. </tr>
  321. </thead>
  322. <tbody>
  323. <tr>
  324. <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.ilist">IList</a></td>
  325. <td></td>
  326. </tr>
  327. </tbody>
  328. </table>
  329. </article>
  330. </div>
  331. <div class="hidden-sm col-md-2" role="complementary">
  332. <div class="sideaffix">
  333. <div class="contribution">
  334. <ul class="nav">
  335. <li>
  336. <a href="https://github.com/gui-cs/Terminal.Gui/new/develop/docfx/overrides/new?filename=Terminal_Gui_IListDataSource.md&amp;value=---%0Auid%3A%20Terminal.Gui.IListDataSource%0Asummary%3A%20&#39;*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax&#39;%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A" class="contribution-link">Edit this page</a>
  337. </li>
  338. <li>
  339. <a href="tig:tig/Terminal.Gui/blob/v2_develop/Terminal.Gui/Views/ListView.cs/#L13" class="contribution-link">View Source</a>
  340. </li>
  341. </ul>
  342. </div>
  343. <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
  344. <h5>In this article</h5>
  345. <div></div>
  346. </nav>
  347. </div>
  348. </div>
  349. </div>
  350. </div>
  351. <footer>
  352. <div class="grad-bottom"></div>
  353. <div class="footer">
  354. <div class="container">
  355. <span class="pull-right">
  356. <a href="#top">Back to top</a>
  357. </span>
  358. <span>Generated by <strong>DocFX</strong></span>
  359. </div>
  360. </div>
  361. </footer>
  362. </div>
  363. <script type="text/javascript" src="../../styles/docfx.vendor.min.js"></script>
  364. <script type="text/javascript" src="../../styles/docfx.js"></script>
  365. <script type="text/javascript" src="../../styles/main.js"></script>
  366. </body>
  367. </html>