Table of Contents

Class CSTOJSOptions

Namespace
CSharpToJavaScript
Assembly
CSharpToJavaScript.dll

Options for CSTOJS.

public record CSTOJSOptions : IEquatable<CSTOJSOptions>
Inheritance
CSTOJSOptions
Implements
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! When passing a folder path to GenerateOneAsync(string, string?) applies to every file!

AddSBAtTheTop

Add a StringBuilder to the front of a javascript file.

public StringBuilder AddSBAtTheTop { get; set; }

Property Value

StringBuilder

Default: new()

Remarks

Note! When passing a folder path to GenerateOneAsync(string, string?) applies to every file!

CustomCSNamesToJS

List of custom names to convert.

public List<Tuple<string, string>> CustomCSNamesToJS { get; set; }

Property Value

List<Tuple<string, string>>

Default: new()

Remarks

Example: new List<Tuple<string, string>>(){new Tuple<string, string>("Console", "console")}. Will convert "Console" to "console".

CustomCSTypesToJS

List of types to convert.

public List<Type> CustomCSTypesToJS { get; set; }

Property Value

List<Type>

Default: new()

Remarks

Example: Similar to CustomCSNamesToJS, but convers the type. You need to use ToAttribute.

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

DisableConsoleColors

Self-explanatory, Disable Console Colors.

public bool DisableConsoleColors { get; set; }

Property Value

bool

Default: false

DisableConsoleOutput

Self-explanatory, Disable Console Output.

public bool DisableConsoleOutput { get; set; }

Property Value

bool

Default: 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.

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.

OutPutPath

Output path for javascript file/files.

public string OutPutPath { get; set; }

Property Value

string

Default: GetCurrentDirectory()

UseStrictEquality

Replace '==' with '===' and '!=' with '!=='.

public bool UseStrictEquality { get; set; }

Property Value

bool

Default: false

UseVarOverLet

Self-explanatory, Use var over let.

public bool UseVarOverLet { get; set; }

Property Value

bool

Default: false