Terminal.Gui.Attribute.html 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519
  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.59.0.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_" data-uid="Terminal.Gui.Attribute.#ctor(System.Int32)">Attribute(Int32)</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 with only the value passed to
  118. and trying to get the colors if defined.
  119. </div>
  120. <div class="markdown level1 conceptual"></div>
  121. <h5 class="decalaration">Declaration</h5>
  122. <div class="codewrapper">
  123. <pre><code class="lang-csharp hljs">public Attribute(int value)</code></pre>
  124. </div>
  125. <h5 class="parameters">Parameters</h5>
  126. <table class="table table-bordered table-striped table-condensed">
  127. <thead>
  128. <tr>
  129. <th>Type</th>
  130. <th>Name</th>
  131. <th>Description</th>
  132. </tr>
  133. </thead>
  134. <tbody>
  135. <tr>
  136. <td><span class="xref">System.Int32</span></td>
  137. <td><span class="parametername">value</span></td>
  138. <td>Value.</td>
  139. </tr>
  140. </tbody>
  141. </table>
  142. <a id="Terminal_Gui_Attribute__ctor_" data-uid="Terminal.Gui.Attribute.#ctor*"></a>
  143. <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>
  144. <div class="markdown level1 summary">
  145. Initializes a new instance of the <a class="xref" href="Terminal.Gui.Attribute.html">Attribute</a> struct.
  146. </div>
  147. <div class="markdown level1 conceptual"></div>
  148. <h5 class="decalaration">Declaration</h5>
  149. <div class="codewrapper">
  150. <pre><code class="lang-csharp hljs">public Attribute(int value, Color foreground, Color background)</code></pre>
  151. </div>
  152. <h5 class="parameters">Parameters</h5>
  153. <table class="table table-bordered table-striped table-condensed">
  154. <thead>
  155. <tr>
  156. <th>Type</th>
  157. <th>Name</th>
  158. <th>Description</th>
  159. </tr>
  160. </thead>
  161. <tbody>
  162. <tr>
  163. <td><span class="xref">System.Int32</span></td>
  164. <td><span class="parametername">value</span></td>
  165. <td>Value.</td>
  166. </tr>
  167. <tr>
  168. <td><a class="xref" href="Terminal.Gui.Color.html">Color</a></td>
  169. <td><span class="parametername">foreground</span></td>
  170. <td>Foreground</td>
  171. </tr>
  172. <tr>
  173. <td><a class="xref" href="Terminal.Gui.Color.html">Color</a></td>
  174. <td><span class="parametername">background</span></td>
  175. <td>Background</td>
  176. </tr>
  177. </tbody>
  178. </table>
  179. <a id="Terminal_Gui_Attribute__ctor_" data-uid="Terminal.Gui.Attribute.#ctor*"></a>
  180. <h4 id="Terminal_Gui_Attribute__ctor_Terminal_Gui_Color_" data-uid="Terminal.Gui.Attribute.#ctor(Terminal.Gui.Color)">Attribute(Color)</h4>
  181. <div class="markdown level1 summary">
  182. Initializes a new instance of the <a class="xref" href="Terminal.Gui.Attribute.html">Attribute</a> struct
  183. with the same colors for the foreground and background.
  184. </div>
  185. <div class="markdown level1 conceptual"></div>
  186. <h5 class="decalaration">Declaration</h5>
  187. <div class="codewrapper">
  188. <pre><code class="lang-csharp hljs">public Attribute(Color color)</code></pre>
  189. </div>
  190. <h5 class="parameters">Parameters</h5>
  191. <table class="table table-bordered table-striped table-condensed">
  192. <thead>
  193. <tr>
  194. <th>Type</th>
  195. <th>Name</th>
  196. <th>Description</th>
  197. </tr>
  198. </thead>
  199. <tbody>
  200. <tr>
  201. <td><a class="xref" href="Terminal.Gui.Color.html">Color</a></td>
  202. <td><span class="parametername">color</span></td>
  203. <td>The color.</td>
  204. </tr>
  205. </tbody>
  206. </table>
  207. <a id="Terminal_Gui_Attribute__ctor_" data-uid="Terminal.Gui.Attribute.#ctor*"></a>
  208. <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>
  209. <div class="markdown level1 summary">
  210. Initializes a new instance of the <a class="xref" href="Terminal.Gui.Attribute.html">Attribute</a> struct.
  211. </div>
  212. <div class="markdown level1 conceptual"></div>
  213. <h5 class="decalaration">Declaration</h5>
  214. <div class="codewrapper">
  215. <pre><code class="lang-csharp hljs">public Attribute(Color foreground = Color.Black, Color background = Color.Black)</code></pre>
  216. </div>
  217. <h5 class="parameters">Parameters</h5>
  218. <table class="table table-bordered table-striped table-condensed">
  219. <thead>
  220. <tr>
  221. <th>Type</th>
  222. <th>Name</th>
  223. <th>Description</th>
  224. </tr>
  225. </thead>
  226. <tbody>
  227. <tr>
  228. <td><a class="xref" href="Terminal.Gui.Color.html">Color</a></td>
  229. <td><span class="parametername">foreground</span></td>
  230. <td>Foreground</td>
  231. </tr>
  232. <tr>
  233. <td><a class="xref" href="Terminal.Gui.Color.html">Color</a></td>
  234. <td><span class="parametername">background</span></td>
  235. <td>Background</td>
  236. </tr>
  237. </tbody>
  238. </table>
  239. <h3 id="properties">Properties
  240. </h3>
  241. <a id="Terminal_Gui_Attribute_Background_" data-uid="Terminal.Gui.Attribute.Background*"></a>
  242. <h4 id="Terminal_Gui_Attribute_Background" data-uid="Terminal.Gui.Attribute.Background">Background</h4>
  243. <div class="markdown level1 summary">
  244. The background color.
  245. </div>
  246. <div class="markdown level1 conceptual"></div>
  247. <h5 class="decalaration">Declaration</h5>
  248. <div class="codewrapper">
  249. <pre><code class="lang-csharp hljs">public readonly Color Background { get; }</code></pre>
  250. </div>
  251. <h5 class="propertyValue">Property Value</h5>
  252. <table class="table table-bordered table-striped table-condensed">
  253. <thead>
  254. <tr>
  255. <th>Type</th>
  256. <th>Description</th>
  257. </tr>
  258. </thead>
  259. <tbody>
  260. <tr>
  261. <td><a class="xref" href="Terminal.Gui.Color.html">Color</a></td>
  262. <td></td>
  263. </tr>
  264. </tbody>
  265. </table>
  266. <a id="Terminal_Gui_Attribute_Foreground_" data-uid="Terminal.Gui.Attribute.Foreground*"></a>
  267. <h4 id="Terminal_Gui_Attribute_Foreground" data-uid="Terminal.Gui.Attribute.Foreground">Foreground</h4>
  268. <div class="markdown level1 summary">
  269. The foreground color.
  270. </div>
  271. <div class="markdown level1 conceptual"></div>
  272. <h5 class="decalaration">Declaration</h5>
  273. <div class="codewrapper">
  274. <pre><code class="lang-csharp hljs">public readonly Color Foreground { get; }</code></pre>
  275. </div>
  276. <h5 class="propertyValue">Property Value</h5>
  277. <table class="table table-bordered table-striped table-condensed">
  278. <thead>
  279. <tr>
  280. <th>Type</th>
  281. <th>Description</th>
  282. </tr>
  283. </thead>
  284. <tbody>
  285. <tr>
  286. <td><a class="xref" href="Terminal.Gui.Color.html">Color</a></td>
  287. <td></td>
  288. </tr>
  289. </tbody>
  290. </table>
  291. <a id="Terminal_Gui_Attribute_Value_" data-uid="Terminal.Gui.Attribute.Value*"></a>
  292. <h4 id="Terminal_Gui_Attribute_Value" data-uid="Terminal.Gui.Attribute.Value">Value</h4>
  293. <div class="markdown level1 summary">
  294. The color attribute value.
  295. </div>
  296. <div class="markdown level1 conceptual"></div>
  297. <h5 class="decalaration">Declaration</h5>
  298. <div class="codewrapper">
  299. <pre><code class="lang-csharp hljs">public readonly int Value { get; }</code></pre>
  300. </div>
  301. <h5 class="propertyValue">Property Value</h5>
  302. <table class="table table-bordered table-striped table-condensed">
  303. <thead>
  304. <tr>
  305. <th>Type</th>
  306. <th>Description</th>
  307. </tr>
  308. </thead>
  309. <tbody>
  310. <tr>
  311. <td><span class="xref">System.Int32</span></td>
  312. <td></td>
  313. </tr>
  314. </tbody>
  315. </table>
  316. <h3 id="methods">Methods
  317. </h3>
  318. <a id="Terminal_Gui_Attribute_Get_" data-uid="Terminal.Gui.Attribute.Get*"></a>
  319. <h4 id="Terminal_Gui_Attribute_Get" data-uid="Terminal.Gui.Attribute.Get">Get()</h4>
  320. <div class="markdown level1 summary">
  321. Gets the current <a class="xref" href="Terminal.Gui.Attribute.html">Attribute</a> from the driver.
  322. </div>
  323. <div class="markdown level1 conceptual"></div>
  324. <h5 class="decalaration">Declaration</h5>
  325. <div class="codewrapper">
  326. <pre><code class="lang-csharp hljs">public static Attribute Get()</code></pre>
  327. </div>
  328. <h5 class="returns">Returns</h5>
  329. <table class="table table-bordered table-striped table-condensed">
  330. <thead>
  331. <tr>
  332. <th>Type</th>
  333. <th>Description</th>
  334. </tr>
  335. </thead>
  336. <tbody>
  337. <tr>
  338. <td><a class="xref" href="Terminal.Gui.Attribute.html">Attribute</a></td>
  339. <td>The current attribute.</td>
  340. </tr>
  341. </tbody>
  342. </table>
  343. <a id="Terminal_Gui_Attribute_Make_" data-uid="Terminal.Gui.Attribute.Make*"></a>
  344. <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>
  345. <div class="markdown level1 summary">
  346. Creates an <a class="xref" href="Terminal.Gui.Attribute.html">Attribute</a> from the specified foreground and background.
  347. </div>
  348. <div class="markdown level1 conceptual"></div>
  349. <h5 class="decalaration">Declaration</h5>
  350. <div class="codewrapper">
  351. <pre><code class="lang-csharp hljs">public static Attribute Make(Color foreground, Color background)</code></pre>
  352. </div>
  353. <h5 class="parameters">Parameters</h5>
  354. <table class="table table-bordered table-striped table-condensed">
  355. <thead>
  356. <tr>
  357. <th>Type</th>
  358. <th>Name</th>
  359. <th>Description</th>
  360. </tr>
  361. </thead>
  362. <tbody>
  363. <tr>
  364. <td><a class="xref" href="Terminal.Gui.Color.html">Color</a></td>
  365. <td><span class="parametername">foreground</span></td>
  366. <td>Foreground color to use.</td>
  367. </tr>
  368. <tr>
  369. <td><a class="xref" href="Terminal.Gui.Color.html">Color</a></td>
  370. <td><span class="parametername">background</span></td>
  371. <td>Background color to use.</td>
  372. </tr>
  373. </tbody>
  374. </table>
  375. <h5 class="returns">Returns</h5>
  376. <table class="table table-bordered table-striped table-condensed">
  377. <thead>
  378. <tr>
  379. <th>Type</th>
  380. <th>Description</th>
  381. </tr>
  382. </thead>
  383. <tbody>
  384. <tr>
  385. <td><a class="xref" href="Terminal.Gui.Attribute.html">Attribute</a></td>
  386. <td>The make.</td>
  387. </tr>
  388. </tbody>
  389. </table>
  390. <h3 id="operators">Operators
  391. </h3>
  392. <a id="Terminal_Gui_Attribute_op_Implicit_" data-uid="Terminal.Gui.Attribute.op_Implicit*"></a>
  393. <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>
  394. <div class="markdown level1 summary">
  395. Implicitly convert an integer value into an <a class="xref" href="Terminal.Gui.Attribute.html">Attribute</a>
  396. </div>
  397. <div class="markdown level1 conceptual"></div>
  398. <h5 class="decalaration">Declaration</h5>
  399. <div class="codewrapper">
  400. <pre><code class="lang-csharp hljs">public static implicit operator Attribute(int v)</code></pre>
  401. </div>
  402. <h5 class="parameters">Parameters</h5>
  403. <table class="table table-bordered table-striped table-condensed">
  404. <thead>
  405. <tr>
  406. <th>Type</th>
  407. <th>Name</th>
  408. <th>Description</th>
  409. </tr>
  410. </thead>
  411. <tbody>
  412. <tr>
  413. <td><span class="xref">System.Int32</span></td>
  414. <td><span class="parametername">v</span></td>
  415. <td>value</td>
  416. </tr>
  417. </tbody>
  418. </table>
  419. <h5 class="returns">Returns</h5>
  420. <table class="table table-bordered table-striped table-condensed">
  421. <thead>
  422. <tr>
  423. <th>Type</th>
  424. <th>Description</th>
  425. </tr>
  426. </thead>
  427. <tbody>
  428. <tr>
  429. <td><a class="xref" href="Terminal.Gui.Attribute.html">Attribute</a></td>
  430. <td>An attribute with the specified integer value.</td>
  431. </tr>
  432. </tbody>
  433. </table>
  434. <a id="Terminal_Gui_Attribute_op_Implicit_" data-uid="Terminal.Gui.Attribute.op_Implicit*"></a>
  435. <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>
  436. <div class="markdown level1 summary">
  437. Implicit conversion from an <a class="xref" href="Terminal.Gui.Attribute.html">Attribute</a> to the underlying Int32 representation
  438. </div>
  439. <div class="markdown level1 conceptual"></div>
  440. <h5 class="decalaration">Declaration</h5>
  441. <div class="codewrapper">
  442. <pre><code class="lang-csharp hljs">public static implicit operator int (Attribute c)</code></pre>
  443. </div>
  444. <h5 class="parameters">Parameters</h5>
  445. <table class="table table-bordered table-striped table-condensed">
  446. <thead>
  447. <tr>
  448. <th>Type</th>
  449. <th>Name</th>
  450. <th>Description</th>
  451. </tr>
  452. </thead>
  453. <tbody>
  454. <tr>
  455. <td><a class="xref" href="Terminal.Gui.Attribute.html">Attribute</a></td>
  456. <td><span class="parametername">c</span></td>
  457. <td>The attribute to convert</td>
  458. </tr>
  459. </tbody>
  460. </table>
  461. <h5 class="returns">Returns</h5>
  462. <table class="table table-bordered table-striped table-condensed">
  463. <thead>
  464. <tr>
  465. <th>Type</th>
  466. <th>Description</th>
  467. </tr>
  468. </thead>
  469. <tbody>
  470. <tr>
  471. <td><span class="xref">System.Int32</span></td>
  472. <td>The integer value stored in the attribute.</td>
  473. </tr>
  474. </tbody>
  475. </table>
  476. </article>
  477. </div>
  478. <div class="hidden-sm col-md-2" role="complementary">
  479. <div class="sideaffix">
  480. <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
  481. <h5>In This Article</h5>
  482. <div></div>
  483. </nav>
  484. </div>
  485. </div>
  486. </div>
  487. </div>
  488. <footer>
  489. <div class="grad-bottom"></div>
  490. <div class="footer">
  491. <div class="container">
  492. <span class="pull-right">
  493. <a href="#top">Back to top</a>
  494. </span>
  495. <span>Generated by <strong>DocFX</strong></span>
  496. </div>
  497. </div>
  498. </footer>
  499. </div>
  500. <script type="text/javascript" src="../../styles/docfx.vendor.js"></script>
  501. <script type="text/javascript" src="../../styles/docfx.js"></script>
  502. <script type="text/javascript" src="../../styles/main.js"></script>
  503. </body>
  504. </html>