Terminal.Gui.Attribute.html 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485
  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>Struct Attribute
  8. </title>
  9. <meta name="viewport" content="width=device-width">
  10. <meta name="title" content="Struct Attribute
  11. ">
  12. <meta name="generator" content="docfx 2.56.7.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="../../toc.html">
  18. <meta property="docfx:tocrel" content="toc.html">
  19. <meta property="docfx:rel" content="../../">
  20. </head>
  21. <body data-spy="scroll" data-target="#affix" data-offset="120">
  22. <div id="wrapper">
  23. <header>
  24. <nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
  25. <div class="container">
  26. <div class="navbar-header">
  27. <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
  28. <span class="sr-only">Toggle navigation</span>
  29. <span class="icon-bar"></span>
  30. <span class="icon-bar"></span>
  31. <span class="icon-bar"></span>
  32. </button>
  33. <a class="navbar-brand" href="../../index.html">
  34. <img id="logo" class="svg" src="../../images/logo48.png" alt="">
  35. </a>
  36. </div>
  37. <div class="collapse navbar-collapse" id="navbar">
  38. <form class="navbar-form navbar-right" role="search" id="search">
  39. <div class="form-group">
  40. <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
  41. </div>
  42. </form>
  43. </div>
  44. </div>
  45. </nav>
  46. <div class="subnav navbar navbar-default">
  47. <div class="container hide-when-search" id="breadcrumb">
  48. <ul class="breadcrumb">
  49. <li></li>
  50. </ul>
  51. </div>
  52. </div>
  53. </header>
  54. <div class="container body-content">
  55. <div id="search-results">
  56. <div class="search-list">Search Results for <span></span></div>
  57. <div class="sr-items">
  58. <p><i class="glyphicon glyphicon-refresh index-loading"></i></p>
  59. </div>
  60. <ul id="pagination" data-first="First" data-prev="Previous" data-next="Next" data-last="Last"></ul>
  61. </div>
  62. </div>
  63. <div role="main" class="container body-content hide-when-search">
  64. <div class="sidenav hide-when-search">
  65. <a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
  66. <div class="sidetoggle collapse" id="sidetoggle">
  67. <div id="sidetoc"></div>
  68. </div>
  69. </div>
  70. <div class="article row grid-right">
  71. <div class="col-md-10">
  72. <article class="content wrap" id="_content" data-uid="Terminal.Gui.Attribute">
  73. <h1 id="Terminal_Gui_Attribute" data-uid="Terminal.Gui.Attribute" class="text-break">Struct Attribute
  74. </h1>
  75. <div class="markdown level0 summary">
  76. Attributes are used as elements that contain both a foreground and a background or platform specific features
  77. </div>
  78. <div class="markdown level0 conceptual"></div>
  79. <div class="inheritedMembers">
  80. <h5>Inherited Members</h5>
  81. <div>
  82. <span class="xref">System.ValueType.Equals(System.Object)</span>
  83. </div>
  84. <div>
  85. <span class="xref">System.ValueType.GetHashCode()</span>
  86. </div>
  87. <div>
  88. <span class="xref">System.ValueType.ToString()</span>
  89. </div>
  90. <div>
  91. <span class="xref">System.Object.Equals(System.Object, System.Object)</span>
  92. </div>
  93. <div>
  94. <span class="xref">System.Object.GetType()</span>
  95. </div>
  96. <div>
  97. <span class="xref">System.Object.ReferenceEquals(System.Object, System.Object)</span>
  98. </div>
  99. </div>
  100. <h6><strong>Namespace</strong>: <a class="xref" href="Terminal.Gui.html">Terminal.Gui</a></h6>
  101. <h6><strong>Assembly</strong>: Terminal.Gui.dll</h6>
  102. <h5 id="Terminal_Gui_Attribute_syntax">Syntax</h5>
  103. <div class="codewrapper">
  104. <pre><code class="lang-csharp hljs">public struct Attribute</code></pre>
  105. </div>
  106. <h5 id="Terminal_Gui_Attribute_remarks"><strong>Remarks</strong></h5>
  107. <div class="markdown level0 remarks">
  108. <a class="xref" href="Terminal.Gui.Attribute.html">Attribute</a>s are needed to map colors to terminal capabilities that might lack colors, on color
  109. scenarios, they encode both the foreground and the background color and are used in the <a class="xref" href="Terminal.Gui.ColorScheme.html">ColorScheme</a>
  110. class to define color schemes that can be used in your application.
  111. </div>
  112. <h3 id="constructors">Constructors
  113. </h3>
  114. <a id="Terminal_Gui_Attribute__ctor_" data-uid="Terminal.Gui.Attribute.#ctor*"></a>
  115. <h4 id="Terminal_Gui_Attribute__ctor_System_Int32_Terminal_Gui_Color_Terminal_Gui_Color_" data-uid="Terminal.Gui.Attribute.#ctor(System.Int32,Terminal.Gui.Color,Terminal.Gui.Color)">Attribute(Int32, Color, Color)</h4>
  116. <div class="markdown level1 summary">
  117. Initializes a new instance of the <a class="xref" href="Terminal.Gui.Attribute.html">Attribute</a> struct.
  118. </div>
  119. <div class="markdown level1 conceptual"></div>
  120. <h5 class="decalaration">Declaration</h5>
  121. <div class="codewrapper">
  122. <pre><code class="lang-csharp hljs">public Attribute(int value, Color foreground = Color.Black, Color background = Color.Black)</code></pre>
  123. </div>
  124. <h5 class="parameters">Parameters</h5>
  125. <table class="table table-bordered table-striped table-condensed">
  126. <thead>
  127. <tr>
  128. <th>Type</th>
  129. <th>Name</th>
  130. <th>Description</th>
  131. </tr>
  132. </thead>
  133. <tbody>
  134. <tr>
  135. <td><span class="xref">System.Int32</span></td>
  136. <td><span class="parametername">value</span></td>
  137. <td>Value.</td>
  138. </tr>
  139. <tr>
  140. <td><a class="xref" href="Terminal.Gui.Color.html">Color</a></td>
  141. <td><span class="parametername">foreground</span></td>
  142. <td>Foreground</td>
  143. </tr>
  144. <tr>
  145. <td><a class="xref" href="Terminal.Gui.Color.html">Color</a></td>
  146. <td><span class="parametername">background</span></td>
  147. <td>Background</td>
  148. </tr>
  149. </tbody>
  150. </table>
  151. <a id="Terminal_Gui_Attribute__ctor_" data-uid="Terminal.Gui.Attribute.#ctor*"></a>
  152. <h4 id="Terminal_Gui_Attribute__ctor_Terminal_Gui_Color_Terminal_Gui_Color_" data-uid="Terminal.Gui.Attribute.#ctor(Terminal.Gui.Color,Terminal.Gui.Color)">Attribute(Color, Color)</h4>
  153. <div class="markdown level1 summary">
  154. Initializes a new instance of the <a class="xref" href="Terminal.Gui.Attribute.html">Attribute</a> struct.
  155. </div>
  156. <div class="markdown level1 conceptual"></div>
  157. <h5 class="decalaration">Declaration</h5>
  158. <div class="codewrapper">
  159. <pre><code class="lang-csharp hljs">public Attribute(Color foreground = Color.Black, Color background = Color.Black)</code></pre>
  160. </div>
  161. <h5 class="parameters">Parameters</h5>
  162. <table class="table table-bordered table-striped 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="Terminal.Gui.Color.html">Color</a></td>
  173. <td><span class="parametername">foreground</span></td>
  174. <td>Foreground</td>
  175. </tr>
  176. <tr>
  177. <td><a class="xref" href="Terminal.Gui.Color.html">Color</a></td>
  178. <td><span class="parametername">background</span></td>
  179. <td>Background</td>
  180. </tr>
  181. </tbody>
  182. </table>
  183. <h3 id="properties">Properties
  184. </h3>
  185. <a id="Terminal_Gui_Attribute_Background_" data-uid="Terminal.Gui.Attribute.Background*"></a>
  186. <h4 id="Terminal_Gui_Attribute_Background" data-uid="Terminal.Gui.Attribute.Background">Background</h4>
  187. <div class="markdown level1 summary">
  188. The background color.
  189. </div>
  190. <div class="markdown level1 conceptual"></div>
  191. <h5 class="decalaration">Declaration</h5>
  192. <div class="codewrapper">
  193. <pre><code class="lang-csharp hljs">public Color Background { get; }</code></pre>
  194. </div>
  195. <h5 class="propertyValue">Property Value</h5>
  196. <table class="table table-bordered table-striped table-condensed">
  197. <thead>
  198. <tr>
  199. <th>Type</th>
  200. <th>Description</th>
  201. </tr>
  202. </thead>
  203. <tbody>
  204. <tr>
  205. <td><a class="xref" href="Terminal.Gui.Color.html">Color</a></td>
  206. <td></td>
  207. </tr>
  208. </tbody>
  209. </table>
  210. <a id="Terminal_Gui_Attribute_Foreground_" data-uid="Terminal.Gui.Attribute.Foreground*"></a>
  211. <h4 id="Terminal_Gui_Attribute_Foreground" data-uid="Terminal.Gui.Attribute.Foreground">Foreground</h4>
  212. <div class="markdown level1 summary">
  213. The foreground color.
  214. </div>
  215. <div class="markdown level1 conceptual"></div>
  216. <h5 class="decalaration">Declaration</h5>
  217. <div class="codewrapper">
  218. <pre><code class="lang-csharp hljs">public Color Foreground { get; }</code></pre>
  219. </div>
  220. <h5 class="propertyValue">Property Value</h5>
  221. <table class="table table-bordered table-striped table-condensed">
  222. <thead>
  223. <tr>
  224. <th>Type</th>
  225. <th>Description</th>
  226. </tr>
  227. </thead>
  228. <tbody>
  229. <tr>
  230. <td><a class="xref" href="Terminal.Gui.Color.html">Color</a></td>
  231. <td></td>
  232. </tr>
  233. </tbody>
  234. </table>
  235. <a id="Terminal_Gui_Attribute_Value_" data-uid="Terminal.Gui.Attribute.Value*"></a>
  236. <h4 id="Terminal_Gui_Attribute_Value" data-uid="Terminal.Gui.Attribute.Value">Value</h4>
  237. <div class="markdown level1 summary">
  238. The color attribute value.
  239. </div>
  240. <div class="markdown level1 conceptual"></div>
  241. <h5 class="decalaration">Declaration</h5>
  242. <div class="codewrapper">
  243. <pre><code class="lang-csharp hljs">public int Value { get; }</code></pre>
  244. </div>
  245. <h5 class="propertyValue">Property Value</h5>
  246. <table class="table table-bordered table-striped table-condensed">
  247. <thead>
  248. <tr>
  249. <th>Type</th>
  250. <th>Description</th>
  251. </tr>
  252. </thead>
  253. <tbody>
  254. <tr>
  255. <td><span class="xref">System.Int32</span></td>
  256. <td></td>
  257. </tr>
  258. </tbody>
  259. </table>
  260. <h3 id="methods">Methods
  261. </h3>
  262. <a id="Terminal_Gui_Attribute_Get_" data-uid="Terminal.Gui.Attribute.Get*"></a>
  263. <h4 id="Terminal_Gui_Attribute_Get" data-uid="Terminal.Gui.Attribute.Get">Get()</h4>
  264. <div class="markdown level1 summary">
  265. Gets the current <a class="xref" href="Terminal.Gui.Attribute.html">Attribute</a> from the driver.
  266. </div>
  267. <div class="markdown level1 conceptual"></div>
  268. <h5 class="decalaration">Declaration</h5>
  269. <div class="codewrapper">
  270. <pre><code class="lang-csharp hljs">public static Attribute Get()</code></pre>
  271. </div>
  272. <h5 class="returns">Returns</h5>
  273. <table class="table table-bordered table-striped table-condensed">
  274. <thead>
  275. <tr>
  276. <th>Type</th>
  277. <th>Description</th>
  278. </tr>
  279. </thead>
  280. <tbody>
  281. <tr>
  282. <td><a class="xref" href="Terminal.Gui.Attribute.html">Attribute</a></td>
  283. <td>The current attribute.</td>
  284. </tr>
  285. </tbody>
  286. </table>
  287. <a id="Terminal_Gui_Attribute_Make_" data-uid="Terminal.Gui.Attribute.Make*"></a>
  288. <h4 id="Terminal_Gui_Attribute_Make_Terminal_Gui_Color_Terminal_Gui_Color_" data-uid="Terminal.Gui.Attribute.Make(Terminal.Gui.Color,Terminal.Gui.Color)">Make(Color, Color)</h4>
  289. <div class="markdown level1 summary">
  290. Creates an <a class="xref" href="Terminal.Gui.Attribute.html">Attribute</a> from the specified foreground and background.
  291. </div>
  292. <div class="markdown level1 conceptual"></div>
  293. <h5 class="decalaration">Declaration</h5>
  294. <div class="codewrapper">
  295. <pre><code class="lang-csharp hljs">public static Attribute Make(Color foreground, Color background)</code></pre>
  296. </div>
  297. <h5 class="parameters">Parameters</h5>
  298. <table class="table table-bordered table-striped table-condensed">
  299. <thead>
  300. <tr>
  301. <th>Type</th>
  302. <th>Name</th>
  303. <th>Description</th>
  304. </tr>
  305. </thead>
  306. <tbody>
  307. <tr>
  308. <td><a class="xref" href="Terminal.Gui.Color.html">Color</a></td>
  309. <td><span class="parametername">foreground</span></td>
  310. <td>Foreground color to use.</td>
  311. </tr>
  312. <tr>
  313. <td><a class="xref" href="Terminal.Gui.Color.html">Color</a></td>
  314. <td><span class="parametername">background</span></td>
  315. <td>Background color to use.</td>
  316. </tr>
  317. </tbody>
  318. </table>
  319. <h5 class="returns">Returns</h5>
  320. <table class="table table-bordered table-striped table-condensed">
  321. <thead>
  322. <tr>
  323. <th>Type</th>
  324. <th>Description</th>
  325. </tr>
  326. </thead>
  327. <tbody>
  328. <tr>
  329. <td><a class="xref" href="Terminal.Gui.Attribute.html">Attribute</a></td>
  330. <td>The make.</td>
  331. </tr>
  332. </tbody>
  333. </table>
  334. <h3 id="operators">Operators
  335. </h3>
  336. <a id="Terminal_Gui_Attribute_op_Implicit_" data-uid="Terminal.Gui.Attribute.op_Implicit*"></a>
  337. <h4 id="Terminal_Gui_Attribute_op_Implicit_System_Int32__Terminal_Gui_Attribute" data-uid="Terminal.Gui.Attribute.op_Implicit(System.Int32)~Terminal.Gui.Attribute">Implicit(Int32 to Attribute)</h4>
  338. <div class="markdown level1 summary">
  339. Implicitly convert an integer value into an <a class="xref" href="Terminal.Gui.Attribute.html">Attribute</a>
  340. </div>
  341. <div class="markdown level1 conceptual"></div>
  342. <h5 class="decalaration">Declaration</h5>
  343. <div class="codewrapper">
  344. <pre><code class="lang-csharp hljs">public static implicit operator Attribute(int v)</code></pre>
  345. </div>
  346. <h5 class="parameters">Parameters</h5>
  347. <table class="table table-bordered table-striped table-condensed">
  348. <thead>
  349. <tr>
  350. <th>Type</th>
  351. <th>Name</th>
  352. <th>Description</th>
  353. </tr>
  354. </thead>
  355. <tbody>
  356. <tr>
  357. <td><span class="xref">System.Int32</span></td>
  358. <td><span class="parametername">v</span></td>
  359. <td>value</td>
  360. </tr>
  361. </tbody>
  362. </table>
  363. <h5 class="returns">Returns</h5>
  364. <table class="table table-bordered table-striped table-condensed">
  365. <thead>
  366. <tr>
  367. <th>Type</th>
  368. <th>Description</th>
  369. </tr>
  370. </thead>
  371. <tbody>
  372. <tr>
  373. <td><a class="xref" href="Terminal.Gui.Attribute.html">Attribute</a></td>
  374. <td>An attribute with the specified integer value.</td>
  375. </tr>
  376. </tbody>
  377. </table>
  378. <a id="Terminal_Gui_Attribute_op_Implicit_" data-uid="Terminal.Gui.Attribute.op_Implicit*"></a>
  379. <h4 id="Terminal_Gui_Attribute_op_Implicit_Terminal_Gui_Attribute__System_Int32" data-uid="Terminal.Gui.Attribute.op_Implicit(Terminal.Gui.Attribute)~System.Int32">Implicit(Attribute to Int32)</h4>
  380. <div class="markdown level1 summary">
  381. Implicit conversion from an <a class="xref" href="Terminal.Gui.Attribute.html">Attribute</a> to the underlying Int32 representation
  382. </div>
  383. <div class="markdown level1 conceptual"></div>
  384. <h5 class="decalaration">Declaration</h5>
  385. <div class="codewrapper">
  386. <pre><code class="lang-csharp hljs">public static implicit operator int (Attribute c)</code></pre>
  387. </div>
  388. <h5 class="parameters">Parameters</h5>
  389. <table class="table table-bordered table-striped table-condensed">
  390. <thead>
  391. <tr>
  392. <th>Type</th>
  393. <th>Name</th>
  394. <th>Description</th>
  395. </tr>
  396. </thead>
  397. <tbody>
  398. <tr>
  399. <td><a class="xref" href="Terminal.Gui.Attribute.html">Attribute</a></td>
  400. <td><span class="parametername">c</span></td>
  401. <td>The attribute to convert</td>
  402. </tr>
  403. </tbody>
  404. </table>
  405. <h5 class="returns">Returns</h5>
  406. <table class="table table-bordered table-striped table-condensed">
  407. <thead>
  408. <tr>
  409. <th>Type</th>
  410. <th>Description</th>
  411. </tr>
  412. </thead>
  413. <tbody>
  414. <tr>
  415. <td><span class="xref">System.Int32</span></td>
  416. <td>The integer value stored in the attribute.</td>
  417. </tr>
  418. </tbody>
  419. </table>
  420. </article>
  421. </div>
  422. <div class="hidden-sm col-md-2" role="complementary">
  423. <div class="sideaffix">
  424. <div class="contribution">
  425. <ul class="nav">
  426. </ul>
  427. </div>
  428. <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
  429. <h5>In This Article</h5>
  430. <div></div>
  431. </nav>
  432. </div>
  433. </div>
  434. </div>
  435. </div>
  436. <footer>
  437. <div class="grad-bottom"></div>
  438. <div class="footer">
  439. <div class="container">
  440. <span class="pull-right">
  441. <a href="#top">Back to top</a>
  442. </span>
  443. <span>Generated by <strong>DocFX</strong></span>
  444. </div>
  445. </div>
  446. </footer>
  447. </div>
  448. <script type="text/javascript" src="../../styles/docfx.vendor.js"></script>
  449. <script type="text/javascript" src="../../styles/docfx.js"></script>
  450. <script type="text/javascript" src="../../styles/main.js"></script>
  451. </body>
  452. </html>