Class CSTOJSOptions
- Namespace
- CSharpToJavaScript
- Assembly
- CSharpToJavaScript.dll
Options for CSTOJS.
public class CSTOJSOptions
- Inheritance
-
CSTOJSOptions
- Inherited Members
Constructors
CSTOJSOptions()
Creates new default options. See CSTOJSOptions.
public CSTOJSOptions()
Properties
AddSBAtTheBottom
Add a StringBuilder to the end of a javascript file.
public StringBuilder AddSBAtTheBottom { get; set; }
Property Value
- StringBuilder
Default:
new()
Remarks
NOTE
cstojs_options.xml: <Option AddSBAtTheBottom="//this is comment" />
AddSBAtTheTop
Add a StringBuilder to the front of a javascript file.
public StringBuilder AddSBAtTheTop { get; set; }
Property Value
- StringBuilder
Default:
new()
Remarks
NOTE
cstojs_options.xml: <Option AddSBAtTheTop="//this is comment" />
CustomCSNamesToJS
Array of custom names to convert.
public Dictionary<string, string> CustomCSNamesToJS { get; set; }
Property Value
- Dictionary<string, string>
Default:
new()
Remarks
Example: new(){["Console"] = "console"}. Will convert "Console" to "console".
NOTE
cstojs_options.xml: <Option CustomCSNamesToJS="Console-console,WriteLine-log" />
Debug
Debug. When set to true prints additional info to console, cs lines to js file.
public bool Debug { get; set; }
Property Value
- bool
Default:
false
Remarks
NOTE
cstojs_options.xml: <Option Debug="false" />
DisableCompilationErrors
Useful for the tests.
public bool DisableCompilationErrors { get; set; }
Property Value
- bool
Default:
false
Remarks
NOTE
cstojs_options.xml: <Option DisableCompilationErrors="false" />
KeepBraceOnTheSameLine
Keep Brace { on the same line.
public bool KeepBraceOnTheSameLine { get; set; }
Property Value
- bool
Default:
false
Remarks
NOTE
Note: It is better write from the start in c#, then using this option.
NOTE
cstojs_options.xml: <Option KeepBraceOnTheSameLine="false" />
NormalizeWhitespace
Self-explanatory, Normalize Whitespace.
public bool NormalizeWhitespace { get; set; }
Property Value
- bool
Default:
false
Remarks
NOTE
Note: If using with KeepBraceOnTheSameLine. Normalization running before KeepBraceOnTheSameLine.
NOTE
cstojs_options.xml: <Option NormalizeWhitespace="false" />
TranslateFile
Translate current FileData. If false, walker will not be called.
public bool TranslateFile { get; set; }
Property Value
- bool
Default:
true
Remarks
NOTE
cstojs_options.xml: <Option TranslateFile="true" />
UseVarOverLet
Self-explanatory, Use var over let.
public bool UseVarOverLet { get; set; }
Property Value
- bool
Default:
false
Remarks
NOTE
cstojs_options.xml: <Option UseVarOverLet="false" />