-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCodeFactory.SourceFormatter.html
More file actions
389 lines (362 loc) · 17.5 KB
/
CodeFactory.SourceFormatter.html
File metadata and controls
389 lines (362 loc) · 17.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
<!DOCTYPE html>
<!--[if IE]><![endif]-->
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Class SourceFormatter
| CodeFactory for Windows </title>
<meta name="viewport" content="width=device-width">
<meta name="title" content="Class SourceFormatter
| CodeFactory for Windows ">
<meta name="generator" content="docfx ">
<link rel="shortcut icon" href="../images/favicon.png">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/styles/night-owl.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.2/font/bootstrap-icons.css" integrity="sha384-EvBWSlnoFgZlXJvpzS+MAUEjvN7+gcCwH+qh7GRFOGgZO0PuwOFro7qPOJnLfe7l" crossorigin="anonymous">
<link rel="stylesheet" href="../styles/config.css">
<link rel="stylesheet" href="../styles/discord.css">
<link rel="stylesheet" href="../styles/singulink.css">
<link rel="stylesheet" href="../styles/main.css">
<meta property="docfx:navrel" content="../toc.html">
<meta property="docfx:tocrel" content="toc.html">
<meta property="docfx:rel" content="../">
<meta property="docfx:newtab" content="true">
</head>
<body>
<div class="top-navbar">
<a class="burger-icon" onclick="toggleMenu()">
<svg name="Hamburger" style="vertical-align: middle;" width="34" height="34" viewbox="0 0 24 24"><path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M20 6H4V9H20V6ZM4 10.999H20V13.999H4V10.999ZM4 15.999H20V18.999H4V15.999Z"></path></svg>
</a>
<a class="brand" href="../index.html">
<img src="../images/logo.png" alt="CodeFactory for Windows" class="logomark">
<span class="brand-title">CodeFactory for Windows</span>
</a> </div>
<div class="body-content">
<div id="blackout" class="blackout" onclick="toggleMenu()"></div>
<nav id="sidebar" role="navigation">
<div class="sidebar">
<div>
<div class="mobile-hide">
<a class="brand" href="../index.html">
<img src="../images/logo.png" alt="CodeFactory for Windows" class="logomark">
<span class="brand-title">CodeFactory for Windows</span>
</a> </div>
<div class="sidesearch">
<form id="search" role="search" class="search">
<i class="bi bi-search search-icon"></i>
<input type="text" id="search-query" placeholder="Search" autocomplete="off">
</form>
</div>
<div id="navbar">
</div>
</div> <div class="sidebar-item-separator"></div>
<div id="sidetoggle">
<div id="sidetoc"></div>
</div>
</div>
<div class="footer">
<strong><a href='https://www.codefactory.software'>CodeFactory</a></strong>
</div> </nav>
<main class="main-panel">
<div id="search-results" style="display: none;">
<h1 class="search-list">Search Results for <span></span></h1>
<div class="sr-items">
<p><i class="bi bi-hourglass-split index-loading"></i></p>
</div>
<ul id="pagination" data-first="First" data-prev="Previous" data-next="Next" data-last="Last"></ul>
</div>
<div role="main" class="hide-when-search">
<div class="subnav navbar navbar-default">
<div class="container hide-when-search" id="breadcrumb">
<ul class="breadcrumb">
<li></li>
</ul>
</div>
</div>
<article class="content wrap" id="_content" data-uid="CodeFactory.SourceFormatter">
<h1 id="CodeFactory_SourceFormatter" data-uid="CodeFactory.SourceFormatter" class="text-break">Class SourceFormatter
</h1>
<div class="markdown level0 summary"><p>Base implementation of source code formatting. This allows for control of formatted output from CodeFactory.</p>
</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"><span class="xref">SourceFormatter</span></div>
</div>
<div class="implements">
<h5>Implements</h5>
<div><a class="xref" href="CodeFactory.ISourceFormatter.html">ISourceFormatter</a></div>
</div>
<div class="inheritedMembers">
<h5>Inherited Members</h5>
<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>
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.tostring">object.ToString()</a>
</div>
</div>
<h6><strong>Namespace</strong>: <a class="xref" href="CodeFactory.html">CodeFactory</a></h6>
<h6><strong>Assembly</strong>: CodeFactory.dll</h6>
<h5 id="CodeFactory_SourceFormatter_syntax">Syntax</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public class SourceFormatter : ISourceFormatter</code></pre>
</div>
<h3 id="constructors">Constructors
</h3>
<a id="CodeFactory_SourceFormatter__ctor_" data-uid="CodeFactory.SourceFormatter.#ctor*"></a>
<h4 id="CodeFactory_SourceFormatter__ctor_System_String_" data-uid="CodeFactory.SourceFormatter.#ctor(System.String)">SourceFormatter(string)</h4>
<div class="markdown level1 summary"><p>Creates a new instance of the <a class="xref" href="CodeFactory.SourceFormatter.html">SourceFormatter</a></p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public SourceFormatter(string indentStatement = "\t")</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered 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">indentStatement</span></td>
<td><p>Optional parameter that allows you to set the target type of indent that will occur with each code statement.</p>
</td>
</tr>
</tbody>
</table>
<h3 id="methods">Methods
</h3>
<a id="CodeFactory_SourceFormatter_AppendCode_" data-uid="CodeFactory.SourceFormatter.AppendCode*"></a>
<h4 id="CodeFactory_SourceFormatter_AppendCode_System_String_" data-uid="CodeFactory.SourceFormatter.AppendCode(System.String)">AppendCode(string)</h4>
<div class="markdown level1 summary"><p>Appends code to the end of the current line in the formatter.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void AppendCode(string code)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered 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">code</span></td>
<td><p>The code to append.</p>
</td>
</tr>
</tbody>
</table>
<a id="CodeFactory_SourceFormatter_AppendCodeBlock_" data-uid="CodeFactory.SourceFormatter.AppendCodeBlock*"></a>
<h4 id="CodeFactory_SourceFormatter_AppendCodeBlock_System_Int32_System_Collections_Generic_IEnumerable_System_String__" data-uid="CodeFactory.SourceFormatter.AppendCodeBlock(System.Int32,System.Collections.Generic.IEnumerable{System.String})">AppendCodeBlock(int, IEnumerable<string>)</h4>
<div class="markdown level1 summary"><p>Appends a target indent level to a already formatted block of code.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void AppendCodeBlock(int indentLevel, IEnumerable<string> codeBlock)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered 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.int32">int</a></td>
<td><span class="parametername">indentLevel</span></td>
<td><p>The target indent level to be added to the existing code block.</p>
</td>
</tr>
<tr>
<td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a><<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a>></td>
<td><span class="parametername">codeBlock</span></td>
<td><p>The block of code to append to.</p>
</td>
</tr>
</tbody>
</table>
<a id="CodeFactory_SourceFormatter_AppendCodeBlock_" data-uid="CodeFactory.SourceFormatter.AppendCodeBlock*"></a>
<h4 id="CodeFactory_SourceFormatter_AppendCodeBlock_System_Int32_System_String_" data-uid="CodeFactory.SourceFormatter.AppendCodeBlock(System.Int32,System.String)">AppendCodeBlock(int, string)</h4>
<div class="markdown level1 summary"><p>Appends a target indent level to a already formatted block of code.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void AppendCodeBlock(int indentLevel, string codeBlock)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered 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.int32">int</a></td>
<td><span class="parametername">indentLevel</span></td>
<td><p>The target indent level to be added to the existing code block.</p>
</td>
</tr>
<tr>
<td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
<td><span class="parametername">codeBlock</span></td>
<td><p>The block of code to append to.</p>
</td>
</tr>
</tbody>
</table>
<a id="CodeFactory_SourceFormatter_AppendCodeLine_" data-uid="CodeFactory.SourceFormatter.AppendCodeLine*"></a>
<h4 id="CodeFactory_SourceFormatter_AppendCodeLine_System_Int32_" data-uid="CodeFactory.SourceFormatter.AppendCodeLine(System.Int32)">AppendCodeLine(int)</h4>
<div class="markdown level1 summary"><p>Appends a new line of code to the formatter.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void AppendCodeLine(int indentLevel)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered 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.int32">int</a></td>
<td><span class="parametername">indentLevel</span></td>
<td><p>The number of indent levels to add to the source code.</p>
</td>
</tr>
</tbody>
</table>
<a id="CodeFactory_SourceFormatter_AppendCodeLine_" data-uid="CodeFactory.SourceFormatter.AppendCodeLine*"></a>
<h4 id="CodeFactory_SourceFormatter_AppendCodeLine_System_Int32_System_String_" data-uid="CodeFactory.SourceFormatter.AppendCodeLine(System.Int32,System.String)">AppendCodeLine(int, string)</h4>
<div class="markdown level1 summary"><p>Appends a new line of code to the formatter.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void AppendCodeLine(int indentLevel, string code)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered 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.int32">int</a></td>
<td><span class="parametername">indentLevel</span></td>
<td><p>The number of indent levels to add to the source code.</p>
</td>
</tr>
<tr>
<td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
<td><span class="parametername">code</span></td>
<td><p>The code to add to the formatter.</p>
</td>
</tr>
</tbody>
</table>
<a id="CodeFactory_SourceFormatter_ResetFormatter_" data-uid="CodeFactory.SourceFormatter.ResetFormatter*"></a>
<h4 id="CodeFactory_SourceFormatter_ResetFormatter" data-uid="CodeFactory.SourceFormatter.ResetFormatter">ResetFormatter()</h4>
<div class="markdown level1 summary"><p>Clears the formatter to be reused.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void ResetFormatter()</code></pre>
</div>
<a id="CodeFactory_SourceFormatter_ReturnSource_" data-uid="CodeFactory.SourceFormatter.ReturnSource*"></a>
<h4 id="CodeFactory_SourceFormatter_ReturnSource" data-uid="CodeFactory.SourceFormatter.ReturnSource">ReturnSource()</h4>
<div class="markdown level1 summary"><p>Returns the formatted source code.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public string ReturnSource()</code></pre>
</div>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
<thead>
<tr>
<th>Type</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><p>Formatted SourceCode.</p>
</td>
</tr>
</tbody>
</table>
<h3 id="implements">Implements</h3>
<div>
<a class="xref" href="CodeFactory.ISourceFormatter.html">ISourceFormatter</a>
</div>
</article>
</div>
<div class="copyright-footer">
<span>© CodeFactory, LLC. All rights reserved.</span>
</div>
</main>
</div>
<script src="https://code.jquery.com/jquery-3.6.3.min.js" integrity="sha256-pvPw+upLPUjgMXY0G+8O0xUf+/Im1MZjXxxgOcBQBXU=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.min.js" integrity="sha384-+sLIOodYLS7CIrQpBjl+C7nPvqq+FbNUBDunl/OZv93DB7Ln/533i8e/mZXLi/P+" crossorigin="anonymous"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/highlight.min.js"></script>
<script type="text/javascript" src="../styles/jquery.twbsPagination.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/mark.js@8.11.1/dist/jquery.mark.min.js"></script>
<script type="text/javascript" src="../styles/url.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/anchor-js@5.0.0/anchor.min.js"></script>
<script type="text/javascript" src="../styles/docfx.js"></script>
<script type="text/javascript" src="../styles/main.js"></script>
<script type="text/javascript" src="../styles/singulink.js"></script> </body>
</html>