Terminal.Gui.Attribute.html 19 KB

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