Skip to content

Commit 44170b6

Browse files
committed
Added more comments to files.
Updated generated docs. Small other fixes.
1 parent 641e9ca commit 44170b6

File tree

5 files changed

+6473
-6455
lines changed

5 files changed

+6473
-6455
lines changed

CSharpToJavaScript/APIs/JS/Ecma/Math.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ namespace CSharpToJavaScript.APIs.JS
1111
[To(ToAttribute.Default)]
1212
public partial class Math
1313
{
14-
public static float E { get; } = 2.7182818284590452354f;
15-
public static float LN10 { get; } = 2.302585092994046f;
16-
public static float LN2 { get; } = 0.6931471805599453f;
17-
public static float LOG10E { get; } = 0.4342944819032518f;
18-
public static float LOG2E { get; } = 1.4426950408889634f;
19-
public static float PI { get; } = 3.1415926535897932f;
20-
public static float SQRT1_2 { get; } = 0.7071067811865476f;
21-
public static float SQRT2 { get; } = 1.4142135623730951f;
14+
public const float E = 2.7182818284590452354f;
15+
public const float LN10 = 2.302585092994046f;
16+
public const float LN2 = 0.6931471805599453f;
17+
public const float LOG10E = 0.4342944819032518f;
18+
public const float LOG2E = 1.4426950408889634f;
19+
public const float PI = 3.1415926535897932f;
20+
public const float SQRT1_2 = 0.7071067811865476f;
21+
public const float SQRT2 = 1.4142135623730951f;
2222

2323
[To(ToAttribute.FirstCharToLowerCase)]
2424
public static float Abs(float x)

CSharpToJavaScript/CSTOJS.cs

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
global using global::System;
2-
3-
4-
5-
6-
using System.Reflection;
1+
using System.Reflection;
72
using System.Diagnostics;
83
using System.IO;
94
using System.Collections.Generic;
@@ -16,7 +11,10 @@
1611

1712
namespace CSharpToJavaScript
1813
{
19-
public class CSTOJS
14+
/// <summary>
15+
/// Main type for CSharpToJavaScript.
16+
/// </summary>
17+
public class CSTOJS
2018
{
2119
public static SemanticModel Model { get; set; }
2220

@@ -26,6 +24,10 @@ public class CSTOJS
2624

2725
private Walker _Walker = new();
2826

27+
/// <summary>
28+
/// New instance of <see cref="CSTOJS"/> with default options, see <see cref="CSTOJSOptions"/>.
29+
/// </summary>
30+
/// <param name="assembly">Assembly of a project, get by <see cref="Assembly.GetExecutingAssembly" /></param>
2931
public CSTOJS(Assembly assembly)
3032
{
3133
_Assembly = assembly;
@@ -42,6 +44,11 @@ public CSTOJS(Assembly assembly)
4244
Trace.Listeners.Add(new ConsoleTraceListener());
4345
}
4446

47+
/// <summary>
48+
///
49+
/// </summary>
50+
/// <param name="assembly">Assembly of a project, get by <see cref="Assembly.GetExecutingAssembly" /></param>
51+
/// <param name="options">Options of <see cref="CSTOJS"/>, see <see cref="CSTOJSOptions"/>.</param>
4552
public CSTOJS(Assembly assembly, CSTOJSOptions options)
4653
{
4754
_Assembly = assembly;
@@ -60,6 +67,11 @@ public CSTOJS(Assembly assembly, CSTOJSOptions options)
6067
Trace.Listeners.Add(new ConsoleTraceListener());
6168
}
6269

70+
/// <summary>
71+
/// Method for generating js file.
72+
/// </summary>
73+
/// <param name="path">Full path to cs file.</param>
74+
/// <returns></returns>
6375
public async Task Generate2Async(string path)
6476
{
6577
string fileCS = await File.ReadAllTextAsync(path);

CSharpToJavaScript/CSTOJSOptions.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,17 @@
55

66
namespace CSharpToJavaScript
77
{
8+
/// <summary>
9+
/// Options for <see cref="CSTOJS" />.
10+
/// </summary>
811
public class CSTOJSOptions
912
{
13+
/// <summary>
14+
/// Debug. When set to true prints additional info to console, cs lines to js file and creates file Debug.txt
15+
/// </summary>
16+
/// <value>
17+
/// Default: <c>false</c>
18+
/// </value>
1019
public bool Debug { get; set; } = false;
1120

1221

@@ -65,7 +74,9 @@ public class CSTOJSOptions
6574
/// Default: <c>new()</c>
6675
/// </value>
6776
public StringBuilder AddSBInEnd { get; set; } = new();
68-
77+
/// <summary>
78+
/// Creates new default options. See <see cref="CSTOJSOptions" />.
79+
/// </summary>
6980
public CSTOJSOptions()
7081
{
7182

0 commit comments

Comments
 (0)