Terminal.Gui.MenuItem.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  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 MenuItem
  8. </title>
  9. <meta name="viewport" content="width=device-width">
  10. <meta name="title" content="Class MenuItem
  11. ">
  12. <meta name="generator" content="docfx 2.18.2.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. <meta property="docfx:navrel" content="">
  18. <meta property="docfx:tocrel" content="../toc.html">
  19. </head>
  20. <body data-spy="scroll" data-target="#affix">
  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="../../logo.svg" 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 role="main" class="container body-content hide-when-search">
  54. <div class="sidenav hide-when-search">
  55. <a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
  56. <div class="sidetoggle collapse" id="sidetoggle">
  57. <div id="sidetoc"></div>
  58. </div>
  59. </div>
  60. <div class="article row grid-right">
  61. <div class="col-md-10">
  62. <article class="content wrap" id="_content" data-uid="Terminal.Gui.MenuItem">
  63. <h1 id="Terminal_Gui_MenuItem" data-uid="Terminal.Gui.MenuItem">Class MenuItem
  64. </h1>
  65. <div class="markdown level0 summary"><p>A menu item has a title, an associated help text, and an action to execute on activation.</p>
  66. </div>
  67. <div class="markdown level0 conceptual"></div>
  68. <div class="inheritance">
  69. <h5>Inheritance</h5>
  70. <div class="level0"><span class="xref">System.Object</span></div>
  71. <div class="level1"><span class="xref">MenuItem</span></div>
  72. </div>
  73. <h6><strong>Namespace</strong>: <a class="xref" href="../Terminal.Gui.html">Terminal.Gui</a></h6>
  74. <h6><strong>Assembly</strong>: Terminal.Gui.dll</h6>
  75. <h5 id="Terminal_Gui_MenuItem_syntax">Syntax</h5>
  76. <div class="codewrapper">
  77. <pre><code class="lang-csharp hljs">public class MenuItem</code></pre>
  78. </div>
  79. <h3 id="constructors">Constructors
  80. </h3>
  81. <a id="Terminal_Gui_MenuItem__ctor_" data-uid="Terminal.Gui.MenuItem.#ctor*"></a>
  82. <h4 id="Terminal_Gui_MenuItem__ctor_NStack_ustring_System_String_System_Action_" data-uid="Terminal.Gui.MenuItem.#ctor(NStack.ustring,System.String,System.Action)">MenuItem(ustring, String, Action)</h4>
  83. <div class="markdown level1 summary"><p>Initializes a new <a class="xref" href="Terminal.Gui.MenuItem.html">MenuItem</a>.</p>
  84. </div>
  85. <div class="markdown level1 conceptual"></div>
  86. <h5 class="decalaration">Declaration</h5>
  87. <div class="codewrapper">
  88. <pre><code class="lang-csharp hljs">public MenuItem (NStack.ustring title, string help, Action action);</code></pre>
  89. </div>
  90. <h5 class="parameters">Parameters</h5>
  91. <table class="table table-bordered table-striped table-condensed">
  92. <thead>
  93. <tr>
  94. <th>Type</th>
  95. <th>Name</th>
  96. <th>Description</th>
  97. </tr>
  98. </thead>
  99. <tbody>
  100. <tr>
  101. <td><span class="xref">NStack.ustring</span></td>
  102. <td><span class="parametername">title</span></td>
  103. <td><p>Title for the menu item.</p>
  104. </td>
  105. </tr>
  106. <tr>
  107. <td><span class="xref">System.String</span></td>
  108. <td><span class="parametername">help</span></td>
  109. <td><p>Help text to display.</p>
  110. </td>
  111. </tr>
  112. <tr>
  113. <td><span class="xref">System.Action</span></td>
  114. <td><span class="parametername">action</span></td>
  115. <td><p>Action to invoke when the menu item is activated.</p>
  116. </td>
  117. </tr>
  118. </tbody>
  119. </table>
  120. <a id="Terminal_Gui_MenuItem__ctor_" data-uid="Terminal.Gui.MenuItem.#ctor*"></a>
  121. <h4 id="Terminal_Gui_MenuItem__ctor_System_String_System_String_System_Action_" data-uid="Terminal.Gui.MenuItem.#ctor(System.String,System.String,System.Action)">MenuItem(String, String, Action)</h4>
  122. <div class="markdown level1 summary"><p>Initializes a new <a class="xref" href="../Terminal/Terminal.MenuItem.html">MenuItem</a>.</p>
  123. </div>
  124. <div class="markdown level1 conceptual"></div>
  125. <h5 class="decalaration">Declaration</h5>
  126. <div class="codewrapper">
  127. <pre><code class="lang-csharp hljs">public MenuItem (string title, string help, Action action);</code></pre>
  128. </div>
  129. <h5 class="parameters">Parameters</h5>
  130. <table class="table table-bordered table-striped table-condensed">
  131. <thead>
  132. <tr>
  133. <th>Type</th>
  134. <th>Name</th>
  135. <th>Description</th>
  136. </tr>
  137. </thead>
  138. <tbody>
  139. <tr>
  140. <td><span class="xref">System.String</span></td>
  141. <td><span class="parametername">title</span></td>
  142. <td><p>Title for the menu item.</p>
  143. </td>
  144. </tr>
  145. <tr>
  146. <td><span class="xref">System.String</span></td>
  147. <td><span class="parametername">help</span></td>
  148. <td><p>Help text to display.</p>
  149. </td>
  150. </tr>
  151. <tr>
  152. <td><span class="xref">System.Action</span></td>
  153. <td><span class="parametername">action</span></td>
  154. <td><p>Action to invoke when the menu item is activated.</p>
  155. </td>
  156. </tr>
  157. </tbody>
  158. </table>
  159. <h3 id="fields">Fields
  160. </h3>
  161. <h4 id="Terminal_Gui_MenuItem_HotKey" data-uid="Terminal.Gui.MenuItem.HotKey">HotKey</h4>
  162. <div class="markdown level1 summary"><p>The hotkey is used when the menu is active, the shortcut can be triggered when the menu is not active.<br> For example HotKey would be &quot;N&quot; when the File Menu is open (assuming there is a &quot;_New&quot; entry
  163. if the ShortCut is set to &quot;Control-N&quot;, this would be a global hotkey that would trigger as well</p>
  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 Rune HotKey;</code></pre>
  169. </div>
  170. <h5 class="fieldValue">Field Value</h5>
  171. <table class="table table-bordered table-striped table-condensed">
  172. <thead>
  173. <tr>
  174. <th>Type</th>
  175. <th>Description</th>
  176. </tr>
  177. </thead>
  178. <tbody>
  179. <tr>
  180. <td><span class="xref">System.Rune</span></td>
  181. <td><p>To be added.</p>
  182. </td>
  183. </tr>
  184. </tbody>
  185. </table>
  186. <h4 id="Terminal_Gui_MenuItem_ShortCut" data-uid="Terminal.Gui.MenuItem.ShortCut">ShortCut</h4>
  187. <div class="markdown level1 summary"><p>This is the global setting that can be used as a global shortcut to invoke the action on the menu.</p>
  188. </div>
  189. <div class="markdown level1 conceptual"></div>
  190. <h5 class="decalaration">Declaration</h5>
  191. <div class="codewrapper">
  192. <pre><code class="lang-csharp hljs">public Terminal.Gui.Key ShortCut;</code></pre>
  193. </div>
  194. <h5 class="fieldValue">Field Value</h5>
  195. <table class="table table-bordered table-striped table-condensed">
  196. <thead>
  197. <tr>
  198. <th>Type</th>
  199. <th>Description</th>
  200. </tr>
  201. </thead>
  202. <tbody>
  203. <tr>
  204. <td><a class="xref" href="Terminal.Gui.Key.html">Key</a></td>
  205. <td><p>To be added.</p>
  206. </td>
  207. </tr>
  208. </tbody>
  209. </table>
  210. <h3 id="properties">Properties
  211. </h3>
  212. <a id="Terminal_Gui_MenuItem_Action_" data-uid="Terminal.Gui.MenuItem.Action*"></a>
  213. <h4 id="Terminal_Gui_MenuItem_Action" data-uid="Terminal.Gui.MenuItem.Action">Action</h4>
  214. <div class="markdown level1 summary"><p>Gets or sets the action to be invoked when the menu is triggered</p>
  215. </div>
  216. <div class="markdown level1 conceptual"></div>
  217. <h5 class="decalaration">Declaration</h5>
  218. <div class="codewrapper">
  219. <pre><code class="lang-csharp hljs">public Action Action { get; set; }</code></pre>
  220. </div>
  221. <h5 class="propertyValue">Property Value</h5>
  222. <table class="table table-bordered table-striped table-condensed">
  223. <thead>
  224. <tr>
  225. <th>Type</th>
  226. <th>Description</th>
  227. </tr>
  228. </thead>
  229. <tbody>
  230. <tr>
  231. <td><span class="xref">System.Action</span></td>
  232. <td><p>Method to invoke.</p>
  233. </td>
  234. </tr>
  235. </tbody>
  236. </table>
  237. <a id="Terminal_Gui_MenuItem_Help_" data-uid="Terminal.Gui.MenuItem.Help*"></a>
  238. <h4 id="Terminal_Gui_MenuItem_Help" data-uid="Terminal.Gui.MenuItem.Help">Help</h4>
  239. <div class="markdown level1 summary"><p>Gets or sets the help text for the menu item.</p>
  240. </div>
  241. <div class="markdown level1 conceptual"></div>
  242. <h5 class="decalaration">Declaration</h5>
  243. <div class="codewrapper">
  244. <pre><code class="lang-csharp hljs">public NStack.ustring Help { get; set; }</code></pre>
  245. </div>
  246. <h5 class="propertyValue">Property Value</h5>
  247. <table class="table table-bordered table-striped table-condensed">
  248. <thead>
  249. <tr>
  250. <th>Type</th>
  251. <th>Description</th>
  252. </tr>
  253. </thead>
  254. <tbody>
  255. <tr>
  256. <td><span class="xref">NStack.ustring</span></td>
  257. <td><p>The help text.</p>
  258. </td>
  259. </tr>
  260. </tbody>
  261. </table>
  262. <a id="Terminal_Gui_MenuItem_Title_" data-uid="Terminal.Gui.MenuItem.Title*"></a>
  263. <h4 id="Terminal_Gui_MenuItem_Title" data-uid="Terminal.Gui.MenuItem.Title">Title</h4>
  264. <div class="markdown level1 summary"><p>Gets or sets the title.</p>
  265. </div>
  266. <div class="markdown level1 conceptual"></div>
  267. <h5 class="decalaration">Declaration</h5>
  268. <div class="codewrapper">
  269. <pre><code class="lang-csharp hljs">public NStack.ustring Title { get; set; }</code></pre>
  270. </div>
  271. <h5 class="propertyValue">Property Value</h5>
  272. <table class="table table-bordered table-striped table-condensed">
  273. <thead>
  274. <tr>
  275. <th>Type</th>
  276. <th>Description</th>
  277. </tr>
  278. </thead>
  279. <tbody>
  280. <tr>
  281. <td><span class="xref">NStack.ustring</span></td>
  282. <td><p>The title.</p>
  283. </td>
  284. </tr>
  285. </tbody>
  286. </table>
  287. </article>
  288. </div>
  289. <div class="hidden-sm col-md-2" role="complementary">
  290. <div class="sideaffix">
  291. <div class="contribution">
  292. <ul class="nav">
  293. </ul>
  294. </div>
  295. <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
  296. <!-- <p><a class="back-to-top" href="#top">Back to top</a><p> -->
  297. </nav>
  298. </div>
  299. </div>
  300. </div>
  301. </div>
  302. <footer>
  303. <div class="grad-bottom"></div>
  304. <div class="footer">
  305. <div class="container">
  306. <span class="pull-right">
  307. <a href="#top">Back to top</a>
  308. </span>
  309. <span>Copyright © 2015-2017 Microsoft<br>Generated by <strong>DocFX</strong></span>
  310. </div>
  311. </div>
  312. </footer>
  313. </div>
  314. <script type="text/javascript" src="../../styles/docfx.vendor.js"></script>
  315. <script type="text/javascript" src="../../styles/docfx.js"></script>
  316. <script type="text/javascript" src="../../styles/main.js"></script>
  317. </body>
  318. </html>