Terminal.Gui.Attribute.html 19 KB

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