mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-31 10:17:55 +01:00
374 lines
17 KiB
HTML
374 lines
17 KiB
HTML
<!DOCTYPE html>
|
|
<!--[if IE]><![endif]-->
|
|
<html>
|
|
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
|
<title>Class SyntaxHighlighting
|
|
</title>
|
|
<meta name="viewport" content="width=device-width">
|
|
<meta name="title" content="Class SyntaxHighlighting
|
|
">
|
|
<meta name="generator" content="docfx ">
|
|
|
|
<link rel="shortcut icon" href="../../favicon.ico">
|
|
<link rel="stylesheet" href="../../styles/docfx.vendor.css">
|
|
<link rel="stylesheet" href="../../styles/docfx.css">
|
|
<link rel="stylesheet" href="../../styles/main.css">
|
|
<link href="https://fonts.googleapis.com/css?family=Source Sans Pro" rel="stylesheet">
|
|
<link href="https://fonts.googleapis.com/css?family=Source Code Pro" rel="stylesheet">
|
|
<meta property="docfx:navrel" content="../../toc.html">
|
|
<meta property="docfx:tocrel" content="toc.html">
|
|
|
|
<meta property="docfx:rel" content="../../">
|
|
|
|
</head> <body data-spy="scroll" data-target="#affix" data-offset="120">
|
|
<div id="wrapper">
|
|
<header>
|
|
|
|
<nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
|
|
<div class="container">
|
|
<div class="navbar-header">
|
|
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
|
|
<span class="sr-only">Toggle navigation</span>
|
|
<span class="icon-bar"></span>
|
|
<span class="icon-bar"></span>
|
|
<span class="icon-bar"></span>
|
|
</button>
|
|
|
|
<a class="navbar-brand" href="../../index.html">
|
|
<img id="logo" class="svg" src="../../images/logo48.png" alt="">
|
|
</a>
|
|
</div>
|
|
<div class="collapse navbar-collapse" id="navbar">
|
|
<form class="navbar-form navbar-right" role="search" id="search">
|
|
<div class="form-group">
|
|
<input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
|
|
<div class="subnav navbar navbar-default">
|
|
<div class="container hide-when-search" id="breadcrumb">
|
|
<ul class="breadcrumb">
|
|
<li></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
<div class="container body-content">
|
|
|
|
<div id="search-results">
|
|
<div class="search-list">Search Results for <span></span></div>
|
|
<div class="sr-items">
|
|
<p><i class="glyphicon glyphicon-refresh index-loading"></i></p>
|
|
</div>
|
|
<ul id="pagination" data-first="First" data-prev="Previous" data-next="Next" data-last="Last"></ul>
|
|
</div>
|
|
</div>
|
|
<div role="main" class="container body-content hide-when-search">
|
|
|
|
<div class="sidenav hide-when-search">
|
|
<a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
|
|
<div class="sidetoggle collapse" id="sidetoggle">
|
|
<div id="sidetoc"></div>
|
|
</div>
|
|
</div>
|
|
<div class="article row grid-right">
|
|
<div class="col-md-10">
|
|
<article class="content wrap" id="_content" data-uid="UICatalog.Scenarios.SyntaxHighlighting">
|
|
|
|
|
|
|
|
<h1 id="UICatalog_Scenarios_SyntaxHighlighting" data-uid="UICatalog.Scenarios.SyntaxHighlighting" class="text-break">Class SyntaxHighlighting
|
|
</h1>
|
|
<div class="markdown level0 summary"></div>
|
|
<div class="markdown level0 conceptual"></div>
|
|
<div class="inheritance">
|
|
<h5>Inheritance</h5>
|
|
<div class="level0"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></div>
|
|
<div class="level1"><a class="xref" href="UICatalog.Scenario.html">Scenario</a></div>
|
|
<div class="level2"><span class="xref">SyntaxHighlighting</span></div>
|
|
</div>
|
|
<div class="implements">
|
|
<h5>Implements</h5>
|
|
<div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.idisposable">IDisposable</a></div>
|
|
</div>
|
|
<div class="inheritedMembers">
|
|
<h5>Inherited Members</h5>
|
|
<div>
|
|
<a class="xref" href="UICatalog.Scenario.html#UICatalog_Scenario_Theme">Scenario.Theme</a>
|
|
</div>
|
|
<div>
|
|
<a class="xref" href="UICatalog.Scenario.html#UICatalog_Scenario_TopLevelColorScheme">Scenario.TopLevelColorScheme</a>
|
|
</div>
|
|
<div>
|
|
<a class="xref" href="UICatalog.Scenario.html#UICatalog_Scenario_Win">Scenario.Win</a>
|
|
</div>
|
|
<div>
|
|
<a class="xref" href="UICatalog.Scenario.html#UICatalog_Scenario_Init">Scenario.Init()</a>
|
|
</div>
|
|
<div>
|
|
<a class="xref" href="UICatalog.Scenario.html#UICatalog_Scenario_GetName">Scenario.GetName()</a>
|
|
</div>
|
|
<div>
|
|
<a class="xref" href="UICatalog.Scenario.html#UICatalog_Scenario_GetDescription">Scenario.GetDescription()</a>
|
|
</div>
|
|
<div>
|
|
<a class="xref" href="UICatalog.Scenario.html#UICatalog_Scenario_GetCategories">Scenario.GetCategories()</a>
|
|
</div>
|
|
<div>
|
|
<a class="xref" href="UICatalog.Scenario.html#UICatalog_Scenario_ToString">Scenario.ToString()</a>
|
|
</div>
|
|
<div>
|
|
<a class="xref" href="UICatalog.Scenario.html#UICatalog_Scenario_Run">Scenario.Run()</a>
|
|
</div>
|
|
<div>
|
|
<a class="xref" href="UICatalog.Scenario.html#UICatalog_Scenario_RequestStop">Scenario.RequestStop()</a>
|
|
</div>
|
|
<div>
|
|
<a class="xref" href="UICatalog.Scenario.html#UICatalog_Scenario_GetScenarios">Scenario.GetScenarios()</a>
|
|
</div>
|
|
<div>
|
|
<a class="xref" href="UICatalog.Scenario.html#UICatalog_Scenario_Dispose_System_Boolean_">Scenario.Dispose(bool)</a>
|
|
</div>
|
|
<div>
|
|
<a class="xref" href="UICatalog.Scenario.html#UICatalog_Scenario_Dispose">Scenario.Dispose()</a>
|
|
</div>
|
|
<div>
|
|
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)">object.Equals(object)</a>
|
|
</div>
|
|
<div>
|
|
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)">object.Equals(object, object)</a>
|
|
</div>
|
|
<div>
|
|
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.gethashcode">object.GetHashCode()</a>
|
|
</div>
|
|
<div>
|
|
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>
|
|
</div>
|
|
<div>
|
|
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone">object.MemberwiseClone()</a>
|
|
</div>
|
|
<div>
|
|
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.referenceequals">object.ReferenceEquals(object, object)</a>
|
|
</div>
|
|
</div>
|
|
<h6><strong>Namespace</strong>: <a class="xref" href="UICatalog.html">UICatalog</a>.<a class="xref" href="UICatalog.Scenarios.html">Scenarios</a></h6>
|
|
<h6><strong>Assembly</strong>: UICatalog.dll</h6>
|
|
<h5 id="UICatalog_Scenarios_SyntaxHighlighting_syntax">Syntax</h5>
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">[Scenario.ScenarioMetadata("Syntax Highlighting", "Text editor with keyword highlighting using the TextView control.")]
|
|
[Scenario.ScenarioCategory("Text and Formatting")]
|
|
[Scenario.ScenarioCategory("Controls")]
|
|
[Scenario.ScenarioCategory("TextView")]
|
|
public class SyntaxHighlighting : Scenario, IDisposable</code></pre>
|
|
</div>
|
|
<h3 id="methods">Methods
|
|
</h3>
|
|
<span class="small pull-right mobile-hide">
|
|
<span class="divider">|</span>
|
|
<a href="https://github.com/gui-cs/Terminal.Gui/new/v2_develop/docfx/overrides/new?filename=UICatalog_Scenarios_SyntaxHighlighting_ReadFromJsonFile__1_System_String_.md&value=---%0Auid%3A%20UICatalog.Scenarios.SyntaxHighlighting.ReadFromJsonFile%60%601(System.String)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
|
|
</span>
|
|
<span class="small pull-right mobile-hide">
|
|
<a href="tig:tig/Terminal.Gui/blob/v2_develop/UICatalog/Scenarios/SyntaxHighlighting.cs/#L308">View Source</a>
|
|
</span>
|
|
<a id="UICatalog_Scenarios_SyntaxHighlighting_ReadFromJsonFile_" data-uid="UICatalog.Scenarios.SyntaxHighlighting.ReadFromJsonFile*"></a>
|
|
<h4 id="UICatalog_Scenarios_SyntaxHighlighting_ReadFromJsonFile__1_System_String_" data-uid="UICatalog.Scenarios.SyntaxHighlighting.ReadFromJsonFile``1(System.String)">ReadFromJsonFile<T>(string)</h4>
|
|
<div class="markdown level1 summary"><p>Reads an object instance from an Json file.</p>
|
|
<p>Object type must have a parameterless constructor.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
<h5 class="decalaration">Declaration</h5>
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static T ReadFromJsonFile<T>(string filePath) where T : new()</code></pre>
|
|
</div>
|
|
<h5 class="parameters">Parameters</h5>
|
|
<table class="table table-bordered table-striped table-condensed">
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Name</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
|
|
<td><span class="parametername">filePath</span></td>
|
|
<td><p>The file path to read the object instance from.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h5 class="returns">Returns</h5>
|
|
<table class="table table-bordered table-striped table-condensed">
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><span class="xref">T</span></td>
|
|
<td><p>Returns a new instance of the object read from the Json file.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h5 class="typeParameters">Type Parameters</h5>
|
|
<table class="table table-bordered table-striped table-condensed">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><span class="parametername">T</span></td>
|
|
<td><p>The type of object to read from the file.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<span class="small pull-right mobile-hide">
|
|
<span class="divider">|</span>
|
|
<a href="https://github.com/gui-cs/Terminal.Gui/new/v2_develop/docfx/overrides/new?filename=UICatalog_Scenarios_SyntaxHighlighting_Setup.md&value=---%0Auid%3A%20UICatalog.Scenarios.SyntaxHighlighting.Setup%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
|
|
</span>
|
|
<span class="small pull-right mobile-hide">
|
|
<a href="tig:tig/Terminal.Gui/blob/v2_develop/UICatalog/Scenarios/SyntaxHighlighting.cs/#L94">View Source</a>
|
|
</span>
|
|
<a id="UICatalog_Scenarios_SyntaxHighlighting_Setup_" data-uid="UICatalog.Scenarios.SyntaxHighlighting.Setup*"></a>
|
|
<h4 id="UICatalog_Scenarios_SyntaxHighlighting_Setup" data-uid="UICatalog.Scenarios.SyntaxHighlighting.Setup">Setup()</h4>
|
|
<div class="markdown level1 summary"><p>Override this to implement the <a class="xref" href="UICatalog.Scenario.html">Scenario</a> setup logic (create controls, etc...).</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
<h5 class="decalaration">Declaration</h5>
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public override void Setup()</code></pre>
|
|
</div>
|
|
<h5 class="overrides">Overrides</h5>
|
|
<div><a class="xref" href="UICatalog.Scenario.html#UICatalog_Scenario_Setup">Scenario.Setup()</a></div>
|
|
<span class="small pull-right mobile-hide">
|
|
<span class="divider">|</span>
|
|
<a href="https://github.com/gui-cs/Terminal.Gui/new/v2_develop/docfx/overrides/new?filename=UICatalog_Scenarios_SyntaxHighlighting_WriteToJsonFile__1_System_String___0_System_Boolean_.md&value=---%0Auid%3A%20UICatalog.Scenarios.SyntaxHighlighting.WriteToJsonFile%60%601(System.String%2C%60%600%2CSystem.Boolean)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
|
|
</span>
|
|
<span class="small pull-right mobile-hide">
|
|
<a href="tig:tig/Terminal.Gui/blob/v2_develop/UICatalog/Scenarios/SyntaxHighlighting.cs/#L287">View Source</a>
|
|
</span>
|
|
<a id="UICatalog_Scenarios_SyntaxHighlighting_WriteToJsonFile_" data-uid="UICatalog.Scenarios.SyntaxHighlighting.WriteToJsonFile*"></a>
|
|
<h4 id="UICatalog_Scenarios_SyntaxHighlighting_WriteToJsonFile__1_System_String___0_System_Boolean_" data-uid="UICatalog.Scenarios.SyntaxHighlighting.WriteToJsonFile``1(System.String,``0,System.Boolean)">WriteToJsonFile<T>(string, T, bool)</h4>
|
|
<div class="markdown level1 summary"><p>Writes the given object instance to a Json file.</p>
|
|
<p>Object type must have a parameterless constructor.</p>
|
|
<p>Only Public properties and variables will be written to the file. These can be any type though, even other classes.</p>
|
|
<p>If there are public properties/variables that you do not want written to the file, decorate them with the [JsonIgnore] attribute.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
<h5 class="decalaration">Declaration</h5>
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static void WriteToJsonFile<T>(string filePath, T objectToWrite, bool append = false) where T : new()</code></pre>
|
|
</div>
|
|
<h5 class="parameters">Parameters</h5>
|
|
<table class="table table-bordered table-striped table-condensed">
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Name</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
|
|
<td><span class="parametername">filePath</span></td>
|
|
<td><p>The file path to write the object instance to.</p>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><span class="xref">T</span></td>
|
|
<td><span class="parametername">objectToWrite</span></td>
|
|
<td><p>The object instance to write to the file.</p>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
|
|
<td><span class="parametername">append</span></td>
|
|
<td><p>If false the file will be overwritten if it already exists. If true the contents will be appended to the file.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h5 class="typeParameters">Type Parameters</h5>
|
|
<table class="table table-bordered table-striped table-condensed">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><span class="parametername">T</span></td>
|
|
<td><p>The type of object being written to the file.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3 id="implements">Implements</h3>
|
|
<div>
|
|
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.idisposable">IDisposable</a>
|
|
</div>
|
|
<h3 id="extensionmethods">Extension Methods</h3>
|
|
<div>
|
|
<a class="xref" href="UICatalog.Scenarios.EventExtensions.html#UICatalog_Scenarios_EventExtensions_ClearEventHandlers_System_Object_System_String_">EventExtensions.ClearEventHandlers(object, string)</a>
|
|
</div>
|
|
|
|
</article>
|
|
</div>
|
|
|
|
<div class="hidden-sm col-md-2" role="complementary">
|
|
<div class="sideaffix">
|
|
<div class="contribution">
|
|
<ul class="nav">
|
|
<li>
|
|
<a href="https://github.com/gui-cs/Terminal.Gui/new/v2_develop/docfx/overrides/new?filename=UICatalog_Scenarios_SyntaxHighlighting.md&value=---%0Auid%3A%20UICatalog.Scenarios.SyntaxHighlighting%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A" class="contribution-link">Improve this Doc</a>
|
|
</li>
|
|
<li>
|
|
<a href="tig:tig/Terminal.Gui/blob/v2_develop/UICatalog/Scenarios/SyntaxHighlighting.cs/#L13" class="contribution-link">View Source</a>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
|
|
<h5>In This Article</h5>
|
|
<div></div>
|
|
</nav>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<footer>
|
|
<div class="grad-bottom"></div>
|
|
<div class="footer">
|
|
<div class="container">
|
|
<span class="pull-right">
|
|
<a href="#top">Back to top</a>
|
|
</span>
|
|
|
|
<span>Generated by <strong>DocFX</strong></span>
|
|
</div>
|
|
</div>
|
|
</footer>
|
|
</div>
|
|
|
|
<script type="text/javascript" src="../../styles/docfx.vendor.min.js"></script>
|
|
<script type="text/javascript" src="../../styles/docfx.js"></script>
|
|
<script type="text/javascript" src="../../styles/main.js"></script>
|
|
</body>
|
|
</html>
|