File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -7,14 +7,13 @@ This is a personal project with purpose to learn and understand better c# and js
77
88### C#
99``` csharp
10- using static CSharpToJavaScript .APIs .JS .GlobalObject .GlobalThis ;
1110namespace ConsoleAppTest .CSharp ;
1211
1312public class Test
1413{
1514 public Test ()
1615 {
17- Console .Log (" HelloWorld!" );
16+ Console .WriteLine (" HelloWorld!" );
1817 }
1918}
2019```
@@ -38,7 +37,7 @@ class Test
3837CSTOJS cstojs = new ();
3938await cstojs .GenerateOneAsync (" FULL PATH TO CSHARP FILE YOU WHAT TO CONVERT" );
4039```
41- - 5 Run program and file will be generated in output path(default is "Directory.GetCurrentDirectory()") with name "|FILE NAME|.js"(default)
40+ - 5 Run program and file will be generated in output path(default is "Directory.GetCurrentDirectory()") with name "|CS FILE NAME|.js"(default)
4241- 6 See below for simple example "HelloWorld"
4342
4443## Example "HelloWorld"
@@ -60,14 +59,17 @@ public class Program
6059```
6160CSharp/Test.cs
6261``` csharp
63- using static CSharpToJavaScript .APIs .JS .GlobalObject .GlobalThis ;
62+ using CSharpToJavaScript .APIs .JS ;
63+
64+ using static CSharpToJavaScript .APIs .JS .GlobalObject ;
65+
6466namespace ConsoleAppTest .CSharp ;
6567
6668public class Test
6769{
6870 public Test ()
6971 {
70- Console .Log (" HelloWorld" );
72+ GlobalThis . Console .Log (" HelloWorld! " );
7173 }
7274}
7375```
@@ -77,7 +79,7 @@ class Test
7779{
7880 constructor ()
7981 {
80- console .log (" HelloWorld" );
82+ globalThis . console .log (" HelloWorld! " );
8183 }
8284}
8385```
You can’t perform that action at this time.
0 commit comments