Class CSTOJS
- Namespace
- CSharpToJavaScript
- Assembly
- CSharpToJavaScript.dll
Main type for CSharpToJavaScript.
public class CSTOJS
- Inheritance
-
CSTOJS
- Inherited Members
Constructors
CSTOJS()
New instance of CSTOJS with default options, see CSTOJSOptions.
public CSTOJS()
CSTOJS(CSTOJSOptions)
New instance of CSTOJS
public CSTOJS(CSTOJSOptions options)
Parameters
options
CSTOJSOptionsOptions of CSTOJS, see CSTOJSOptions.
Methods
GenerateOne(string)
Method for generating js StringBuilder/StringBuilders.
public List<StringBuilder> GenerateOne(string path)
Parameters
path
stringFull path to cs file or to the folder with cs files.
Returns
- List<StringBuilder>
List of StringBuilder
Exceptions
GenerateOneAsync(string, string?)
Method for generating js file/files.
public Task GenerateOneAsync(string path, string? filename = null)
Parameters
path
stringFull path to cs file or to the folder with cs files.
filename
stringOptional! Filename of a js file if you generating one file!
Returns
- Task
empty Task
Exceptions
GenerateOneContinuously(string)
Method for generating continuously by watching the cs file. Writes a file.
public void GenerateOneContinuously(string path)
Parameters
path
stringFull path to cs file.
Remarks
NOTE
Note: You must call StopWatching() before completing a program.
Exceptions
GenerateOneFromString(string, List<MetadataReference>?)
Method for generating from string.
public StringBuilder GenerateOneFromString(string csstring, List<MetadataReference>? references = null)
Parameters
csstring
stringCSharp string.
references
List<MetadataReference>Needed if you don't have access to files. Because Assembly.location is null in Blazor WebAssembly.
Returns
Exceptions
GenerateOneFromStringAsync(string, string?, List<MetadataReference>?)
Method for generating from string. Writes a file.
public Task GenerateOneFromStringAsync(string csstring, string? filename = "main.js", List<MetadataReference>? references = null)
Parameters
csstring
stringCSharp string.
filename
stringFilename of a js file.
references
List<MetadataReference>Needed if you don't have access to files. Because Assembly.location is null in Blazor WebAssembly.
Returns
- Task
empty Task
Exceptions
StopWatching()
Method for stopping watching cs file.
public void StopWatching()