Skip to content

Commit 641e9ca

Browse files
authored
Update README.md
1 parent 9bdc904 commit 641e9ca

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

README.md

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ 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.GlobalThis;
10+
using static CSharpToJavaScript.APIs.JS.GlobalObject.GlobalThis;
1111
namespace ConsoleAppTest.CSharp;
1212

1313
public class Test
@@ -31,7 +31,7 @@ class Test
3131

3232
## How to use
3333
- 1 Create c# project or use existed one
34-
- 2 Install [nuget package](https://www.nuget.org/packages/CSharpToJavaScript/) or Download a specific version, visit [releases](https://github.com/TiLied/CSharpToJavaScript/releases) or Download a master(Code-Local-Download ZIP)
34+
- 2 Install [nuget package](https://www.nuget.org/packages/CSharpToJavaScript/) or Download a specific version(visit [releases](https://github.com/TiLied/CSharpToJavaScript/releases)) or Download a master(Code-Local-Download ZIP)
3535
- 3 Skip this if using Nuget package. Follow [this](https://learn.microsoft.com/en-us/dotnet/core/tutorials/library-with-visual-studio?pivots=dotnet-7-0#add-a-project-reference) to add reference to project.
3636
- 4 In the Main method add:
3737
```csharp
@@ -54,33 +54,23 @@ public class Program
5454
public static async Task Main()
5555
{
5656
Assembly executingAssembly = Assembly.GetExecutingAssembly();
57-
58-
CSTOJSOptions opt = new()
59-
{
60-
CustomCSNamesToJS = new List<Tuple<string, string>>()
61-
{
62-
new Tuple<string, string>("Console","console"),
63-
new Tuple<string, string>("WriteLine", "log")
64-
},
65-
OutPutFileName = "test.js"
66-
};
67-
68-
CSTOJS cstojs = new(executingAssembly, opt);
69-
await cstojs.Generate2Async("C:\\GitReps\\ConsoleAppTest\\CSharp\\test.cs");
57+
CSTOJS cstojs = new(executingAssembly);
58+
await cstojs.Generate2Async("C:\\GitReps\\ConsoleAppTest\\CSharp\\Test.cs");
7059

7160
Console.ReadKey();
7261
}
7362
}
7463
```
7564
CSharp/test.cs
7665
```csharp
66+
using static CSharpToJavaScript.APIs.JS.GlobalObject.GlobalThis;
7767
namespace ConsoleAppTest.CSharp;
7868

7969
public class Test
8070
{
8171
public Test()
8272
{
83-
Console.WriteLine("HelloWorld");
73+
Console.Log("HelloWorld");
8474
}
8575
}
8676
```
@@ -94,6 +84,8 @@ class Test
9484
}
9585
}
9686
```
87+
More examples [here](https://tilied.github.io/CSharpToJavaScript/articles/intro.html). WIP!
88+
9789
## Some Todos
9890
- [ ] More comments in code, especially in [CSTOJSOptions](https://github.com/TiLied/CSharpToJavaScript/blob/master/CSharpToJavaScript/CSTOJSOptions.cs)
9991
- [ ] Wiki?

0 commit comments

Comments
 (0)