|
1 | | -using CSharpToJavaScript.Utils; |
2 | | -using System; |
3 | | -using System.Collections.Generic; |
| 1 | +using System.Collections.Generic; |
4 | 2 | using System.Text; |
5 | 3 |
|
6 | | -namespace CSharpToJavaScript |
| 4 | +namespace CSharpToJavaScript; |
| 5 | + |
| 6 | +/// <summary> |
| 7 | +/// Options for <see cref="CSTOJS" />. |
| 8 | +/// </summary> |
| 9 | +public class CSTOJSOptions |
7 | 10 | { |
8 | 11 | /// <summary> |
9 | | - /// Options for <see cref="CSTOJS" />. |
| 12 | + /// Debug. When set to true prints additional info to console, cs lines to js file. |
10 | 13 | /// </summary> |
11 | | - public class CSTOJSOptions |
12 | | - { |
13 | | - /// <summary> |
14 | | - /// Debug. When set to true prints additional info to console, cs lines to js file. |
15 | | - /// </summary> |
16 | | - /// <value> |
17 | | - /// Default: <c>false</c> |
18 | | - /// </value> |
19 | | - public bool Debug { get; set; } = false; |
20 | | - /// <summary> |
21 | | - /// Useful for the tests. |
22 | | - /// </summary> |
23 | | - /// <value> |
24 | | - /// Default: <c>false</c> |
25 | | - /// </value> |
26 | | - public bool DisableCompilationErrors { get; set; } = false; |
27 | | - |
28 | | - /// <summary> |
29 | | - /// Self-explanatory, Use <c>var</c> over <c>let</c>. |
30 | | - /// </summary> |
31 | | - /// <value> |
32 | | - /// Default: <c>false</c> |
33 | | - /// </value> |
34 | | - public bool UseVarOverLet { get; set; } = false; |
| 14 | + /// <remarks> |
| 15 | + /// <blockquote class="NOTE"><h5>NOTE</h5> |
| 16 | + /// <para> |
| 17 | + /// cstojs_options.xml: <Option Debug="false" /> |
| 18 | + /// </para> |
| 19 | + /// </blockquote> |
| 20 | + /// </remarks> |
| 21 | + /// <value> |
| 22 | + /// Default: <c>false</c> |
| 23 | + /// </value> |
| 24 | + public bool Debug { get; set; } = false; |
| 25 | + /// <summary> |
| 26 | + /// Useful for the tests. |
| 27 | + /// </summary> |
| 28 | + /// <remarks> |
| 29 | + /// <blockquote class="NOTE"><h5>NOTE</h5> |
| 30 | + /// <para> |
| 31 | + /// cstojs_options.xml: <Option DisableCompilationErrors="false" /> |
| 32 | + /// </para> |
| 33 | + /// </blockquote> |
| 34 | + /// </remarks> |
| 35 | + /// <value> |
| 36 | + /// Default: <c>false</c> |
| 37 | + /// </value> |
| 38 | + public bool DisableCompilationErrors { get; set; } = false; |
35 | 39 |
|
36 | | - /// <summary> |
37 | | - /// Keep Brace <c>{</c> on the same line. |
38 | | - /// </summary> |
39 | | - /// <remarks> |
40 | | - /// <blockquote class="NOTE"><h5>NOTE</h5><para>Note: It is better write from the start in c#, then using this option.</para></blockquote> |
41 | | - /// </remarks> |
42 | | - /// <value> |
43 | | - /// Default: <c>false</c> |
44 | | - /// </value> |
45 | | - public bool KeepBraceOnTheSameLine { get; set; } = false; |
| 40 | + /// <summary> |
| 41 | + /// Self-explanatory, Use <c>var</c> over <c>let</c>. |
| 42 | + /// </summary> |
| 43 | + /// <remarks> |
| 44 | + /// <blockquote class="NOTE"><h5>NOTE</h5> |
| 45 | + /// <para> |
| 46 | + /// cstojs_options.xml: <Option UseVarOverLet="false" /> |
| 47 | + /// </para> |
| 48 | + /// </blockquote> |
| 49 | + /// </remarks> |
| 50 | + /// <value> |
| 51 | + /// Default: <c>false</c> |
| 52 | + /// </value> |
| 53 | + public bool UseVarOverLet { get; set; } = false; |
46 | 54 |
|
47 | | - /// <summary> |
48 | | - /// Self-explanatory, Normalize Whitespace. |
49 | | - /// </summary> |
50 | | - /// <remarks> |
51 | | - /// <blockquote class="NOTE"><h5>NOTE</h5><para>Note: If using with <see cref="CSTOJSOptions.KeepBraceOnTheSameLine" />. Normalization running before <see cref="CSTOJSOptions.KeepBraceOnTheSameLine" />.</para></blockquote> |
52 | | - /// </remarks> |
53 | | - /// <value> |
54 | | - /// Default: <c>false</c> |
55 | | - /// </value> |
56 | | - public bool NormalizeWhitespace { get; set; } = false; |
| 55 | + /// <summary> |
| 56 | + /// Keep Brace <c>{</c> on the same line. |
| 57 | + /// </summary> |
| 58 | + /// <remarks> |
| 59 | + /// <blockquote class="NOTE"><h5>NOTE</h5><para>Note: It is better write from the start in c#, then using this option.</para></blockquote> |
| 60 | + /// <blockquote class="NOTE"><h5>NOTE</h5> |
| 61 | + /// <para> |
| 62 | + /// cstojs_options.xml: <Option KeepBraceOnTheSameLine="false" /> |
| 63 | + /// </para> |
| 64 | + /// </blockquote> |
| 65 | + /// </remarks> |
| 66 | + /// <value> |
| 67 | + /// Default: <c>false</c> |
| 68 | + /// </value> |
| 69 | + public bool KeepBraceOnTheSameLine { get; set; } = false; |
57 | 70 |
|
58 | | - /// <summary> |
59 | | - /// Translate current <see cref="FileData" />. If false, walker will not be called. |
60 | | - /// </summary> |
61 | | - /// <value> |
62 | | - /// Default: <c>true</c> |
63 | | - /// </value> |
64 | | - public bool TranslateFile { get; set; } = true; |
| 71 | + /// <summary> |
| 72 | + /// Self-explanatory, Normalize Whitespace. |
| 73 | + /// </summary> |
| 74 | + /// <remarks> |
| 75 | + /// <blockquote class="NOTE"><h5>NOTE</h5><para>Note: If using with <see cref="CSTOJSOptions.KeepBraceOnTheSameLine" />. Normalization running before <see cref="CSTOJSOptions.KeepBraceOnTheSameLine" />.</para></blockquote> |
| 76 | + /// <blockquote class="NOTE"><h5>NOTE</h5> |
| 77 | + /// <para> |
| 78 | + /// cstojs_options.xml: <Option NormalizeWhitespace="false" /> |
| 79 | + /// </para> |
| 80 | + /// </blockquote> |
| 81 | + /// </remarks> |
| 82 | + /// <value> |
| 83 | + /// Default: <c>false</c> |
| 84 | + /// </value> |
| 85 | + public bool NormalizeWhitespace { get; set; } = false; |
65 | 86 |
|
66 | | - /// <summary> |
67 | | - /// Array of custom names to convert. |
68 | | - /// </summary> |
69 | | - /// <remarks>Example: <c>new(){["Console"] = "console"}</c>. Will convert "Console" to "console".</remarks> |
70 | | - /// <value> |
71 | | - /// Default: <c>new()</c> |
72 | | - /// </value> |
73 | | - public Dictionary<string, string> CustomCSNamesToJS { get; set; } = new(); |
| 87 | + /// <summary> |
| 88 | + /// Translate current <see cref="FileData" />. If false, walker will not be called. |
| 89 | + /// </summary> |
| 90 | + /// <remarks> |
| 91 | + /// <blockquote class="NOTE"><h5>NOTE</h5> |
| 92 | + /// <para> |
| 93 | + /// cstojs_options.xml: <Option TranslateFile="true" /> |
| 94 | + /// </para> |
| 95 | + /// </blockquote> |
| 96 | + /// </remarks> |
| 97 | + /// <value> |
| 98 | + /// Default: <c>true</c> |
| 99 | + /// </value> |
| 100 | + public bool TranslateFile { get; set; } = true; |
74 | 101 |
|
75 | | - /// <summary> |
76 | | - /// Add a <see cref="StringBuilder" /> to the front of a javascript file. |
77 | | - /// </summary> |
78 | | - /// <value> |
79 | | - /// Default: <c>new()</c> |
80 | | - /// </value> |
81 | | - public StringBuilder AddSBAtTheTop { get; set; } = new(); |
| 102 | + /// <summary> |
| 103 | + /// Array of custom names to convert. |
| 104 | + /// </summary> |
| 105 | + /// <remarks>Example: <c>new(){["Console"] = "console"}</c>. Will convert "Console" to "console". |
| 106 | + /// <blockquote class="NOTE"><h5>NOTE</h5> |
| 107 | + /// <para> |
| 108 | + /// cstojs_options.xml: <Option CustomCSNamesToJS="Console-console,WriteLine-log" /> |
| 109 | + /// </para> |
| 110 | + /// </blockquote> |
| 111 | + /// </remarks> |
| 112 | + /// <value> |
| 113 | + /// Default: <c>new()</c> |
| 114 | + /// </value> |
| 115 | + public Dictionary<string, string> CustomCSNamesToJS { get; set; } = new(); |
82 | 116 |
|
83 | | - /// <summary> |
84 | | - /// Add a <see cref="StringBuilder" /> to the end of a javascript file. |
85 | | - /// </summary> |
86 | | - /// <value> |
87 | | - /// Default: <c>new()</c> |
88 | | - /// </value> |
89 | | - public StringBuilder AddSBAtTheBottom { get; set; } = new(); |
| 117 | + /// <summary> |
| 118 | + /// Add a <see cref="StringBuilder" /> to the front of a javascript file. |
| 119 | + /// </summary> |
| 120 | + /// <remarks> |
| 121 | + /// <blockquote class="NOTE"><h5>NOTE</h5> |
| 122 | + /// <para> |
| 123 | + /// cstojs_options.xml: <Option AddSBAtTheTop="//this is comment" /> |
| 124 | + /// </para> |
| 125 | + /// </blockquote> |
| 126 | + /// </remarks> |
| 127 | + /// <value> |
| 128 | + /// Default: <c>new()</c> |
| 129 | + /// </value> |
| 130 | + public StringBuilder AddSBAtTheTop { get; set; } = new(); |
90 | 131 |
|
91 | | - /// <summary> |
92 | | - /// Creates new default options. See <see cref="CSTOJSOptions" />. |
93 | | - /// </summary> |
94 | | - public CSTOJSOptions() |
95 | | - { |
| 132 | + /// <summary> |
| 133 | + /// Add a <see cref="StringBuilder" /> to the end of a javascript file. |
| 134 | + /// </summary> |
| 135 | + /// <remarks> |
| 136 | + /// <blockquote class="NOTE"><h5>NOTE</h5> |
| 137 | + /// <para> |
| 138 | + /// cstojs_options.xml: <Option AddSBAtTheBottom="//this is comment" /> |
| 139 | + /// </para> |
| 140 | + /// </blockquote> |
| 141 | + /// </remarks> |
| 142 | + /// <value> |
| 143 | + /// Default: <c>new()</c> |
| 144 | + /// </value> |
| 145 | + public StringBuilder AddSBAtTheBottom { get; set; } = new(); |
| 146 | + |
| 147 | + /// <summary> |
| 148 | + /// Creates new default options. See <see cref="CSTOJSOptions" />. |
| 149 | + /// </summary> |
| 150 | + public CSTOJSOptions() |
| 151 | + { |
96 | 152 |
|
97 | | - } |
98 | 153 | } |
99 | 154 | } |
| 155 | + |
0 commit comments