From 640b5c136fbf71c4f5807f3621253bdcd1c4dbed Mon Sep 17 00:00:00 2001 From: badcommandorfilename Date: Mon, 11 Oct 2021 10:36:11 +1100 Subject: [PATCH 1/5] Update DotNetNormalizer.cs Added string and this to C# reserved keyword list --- .../Normalizers/DotNetNormalizer.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/EventHorizon.Blazor.TypeScript.Interop.Generator/Normalizers/DotNetNormalizer.cs b/Source/EventHorizon.Blazor.TypeScript.Interop.Generator/Normalizers/DotNetNormalizer.cs index bc0c306b..161cf2f3 100644 --- a/Source/EventHorizon.Blazor.TypeScript.Interop.Generator/Normalizers/DotNetNormalizer.cs +++ b/Source/EventHorizon.Blazor.TypeScript.Interop.Generator/Normalizers/DotNetNormalizer.cs @@ -13,6 +13,8 @@ public static class DotNetNormalizer "event", "bool", "virtual", + "string", + "this" }; public static string Normalize( From ae6ac894261cbf06f914ccd4782e69d3b65bbadf Mon Sep 17 00:00:00 2001 From: badcommandorfilename Date: Wed, 13 Oct 2021 13:46:46 +1100 Subject: [PATCH 2/5] Added "params" to reserved C# keywords --- .../Normalizers/DotNetNormalizer.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/EventHorizon.Blazor.TypeScript.Interop.Generator/Normalizers/DotNetNormalizer.cs b/Source/EventHorizon.Blazor.TypeScript.Interop.Generator/Normalizers/DotNetNormalizer.cs index 161cf2f3..88b90756 100644 --- a/Source/EventHorizon.Blazor.TypeScript.Interop.Generator/Normalizers/DotNetNormalizer.cs +++ b/Source/EventHorizon.Blazor.TypeScript.Interop.Generator/Normalizers/DotNetNormalizer.cs @@ -14,7 +14,8 @@ public static class DotNetNormalizer "bool", "virtual", "string", - "this" + "this", + "params" }; public static string Normalize( From aacac78bac02bad02bf539f64224bba63679a463 Mon Sep 17 00:00:00 2001 From: badcommandorfilename Date: Wed, 13 Oct 2021 13:58:42 +1100 Subject: [PATCH 3/5] Updated DotNetNormalized test scenarios --- .../Scenarios/DotNetNormalized.Expected.txt | 60 +++++++++++++++++++ .../Accessors/Scenarios/DotNetNormalized.ts | 3 + 2 files changed, 63 insertions(+) diff --git a/Tests/EventHorizon.Blazor.TypeScript.Interop.Generator.Tests/GenerateClassStatementStringTests/Accessors/Scenarios/DotNetNormalized.Expected.txt b/Tests/EventHorizon.Blazor.TypeScript.Interop.Generator.Tests/GenerateClassStatementStringTests/Accessors/Scenarios/DotNetNormalized.Expected.txt index c1052149..a1f2cdbf 100644 --- a/Tests/EventHorizon.Blazor.TypeScript.Interop.Generator.Tests/GenerateClassStatementStringTests/Accessors/Scenarios/DotNetNormalized.Expected.txt +++ b/Tests/EventHorizon.Blazor.TypeScript.Interop.Generator.Tests/GenerateClassStatementStringTests/Accessors/Scenarios/DotNetNormalized.Expected.txt @@ -167,6 +167,66 @@ namespace Examples return __virtual; } } + + private Vector3 __string; + public Vector3 @string + { + get + { + if(__string == null) + { + __string = EventHorizonBlazorInterop.GetClass( + this.___guid, + "string", + (entity) => + { + return new Vector3() { ___guid = entity.___guid }; + } + ); + } + return __string; + } + } + + private Vector3 __this; + public Vector3 @this + { + get + { + if(__this == null) + { + __this = EventHorizonBlazorInterop.GetClass( + this.___guid, + "this", + (entity) => + { + return new Vector3() { ___guid = entity.___guid }; + } + ); + } + return __this; + } + } + + private Vector3 __params; + public Vector3 @params + { + get + { + if(__params == null) + { + __params = EventHorizonBlazorInterop.GetClass( + this.___guid, + "params", + (entity) => + { + return new Vector3() { ___guid = entity.___guid }; + } + ); + } + return __params; + } + } #endregion #region Properties diff --git a/Tests/EventHorizon.Blazor.TypeScript.Interop.Generator.Tests/GenerateClassStatementStringTests/Accessors/Scenarios/DotNetNormalized.ts b/Tests/EventHorizon.Blazor.TypeScript.Interop.Generator.Tests/GenerateClassStatementStringTests/Accessors/Scenarios/DotNetNormalized.ts index 5ab42e6a..8de29a86 100644 --- a/Tests/EventHorizon.Blazor.TypeScript.Interop.Generator.Tests/GenerateClassStatementStringTests/Accessors/Scenarios/DotNetNormalized.ts +++ b/Tests/EventHorizon.Blazor.TypeScript.Interop.Generator.Tests/GenerateClassStatementStringTests/Accessors/Scenarios/DotNetNormalized.ts @@ -7,5 +7,8 @@ declare module Examples { get event(): Vector3; get bool(): Vector3; get virtual(): Vector3; + get string(): Vector3; + get this(): Vector3; + get params(): Vector3; } } \ No newline at end of file From 907c674717d5cb58da6cb48fc1c97449b4ba4d51 Mon Sep 17 00:00:00 2001 From: badcommandorfilename Date: Wed, 13 Oct 2021 16:13:05 +1100 Subject: [PATCH 4/5] Updated DotNetNormalized properties test --- .../Scenarios/DotNetNormalized.Expected.txt | 87 +++++++++++++++++++ .../Properties/Scenarios/DotNetNormalized.ts | 3 + 2 files changed, 90 insertions(+) diff --git a/Tests/EventHorizon.Blazor.TypeScript.Interop.Generator.Tests/GenerateClassStatementStringTests/Properties/Scenarios/DotNetNormalized.Expected.txt b/Tests/EventHorizon.Blazor.TypeScript.Interop.Generator.Tests/GenerateClassStatementStringTests/Properties/Scenarios/DotNetNormalized.Expected.txt index 0c9f0d04..2e5a44ab 100644 --- a/Tests/EventHorizon.Blazor.TypeScript.Interop.Generator.Tests/GenerateClassStatementStringTests/Properties/Scenarios/DotNetNormalized.Expected.txt +++ b/Tests/EventHorizon.Blazor.TypeScript.Interop.Generator.Tests/GenerateClassStatementStringTests/Properties/Scenarios/DotNetNormalized.Expected.txt @@ -234,6 +234,93 @@ __virtual = null; ); } } + + private Vector3 __string; + public Vector3 @string + { + get + { + if(__string == null) + { + __string = EventHorizonBlazorInterop.GetClass( + this.___guid, + "string", + (entity) => + { + return new Vector3() { ___guid = entity.___guid }; + } + ); + } + return __string; + } + set + { +__string = null; + EventHorizonBlazorInterop.Set( + this.___guid, + "string", + value + ); + } + } + + private Vector3 __this; + public Vector3 @this + { + get + { + if(__this == null) + { + __this = EventHorizonBlazorInterop.GetClass( + this.___guid, + "this", + (entity) => + { + return new Vector3() { ___guid = entity.___guid }; + } + ); + } + return __this; + } + set + { +__this = null; + EventHorizonBlazorInterop.Set( + this.___guid, + "this", + value + ); + } + } + + private Vector3 __params; + public Vector3 @params + { + get + { + if(__params == null) + { + __params = EventHorizonBlazorInterop.GetClass( + this.___guid, + "params", + (entity) => + { + return new Vector3() { ___guid = entity.___guid }; + } + ); + } + return __params; + } + set + { +__params = null; + EventHorizonBlazorInterop.Set( + this.___guid, + "params", + value + ); + } + } #endregion #region Constructor diff --git a/Tests/EventHorizon.Blazor.TypeScript.Interop.Generator.Tests/GenerateClassStatementStringTests/Properties/Scenarios/DotNetNormalized.ts b/Tests/EventHorizon.Blazor.TypeScript.Interop.Generator.Tests/GenerateClassStatementStringTests/Properties/Scenarios/DotNetNormalized.ts index 65b59506..0e18aea9 100644 --- a/Tests/EventHorizon.Blazor.TypeScript.Interop.Generator.Tests/GenerateClassStatementStringTests/Properties/Scenarios/DotNetNormalized.ts +++ b/Tests/EventHorizon.Blazor.TypeScript.Interop.Generator.Tests/GenerateClassStatementStringTests/Properties/Scenarios/DotNetNormalized.ts @@ -7,5 +7,8 @@ declare module Examples { event: Vector3; bool: Vector3; virtual: Vector3; + string: Vector3; + this: Vector3; + params: Vector3; } } \ No newline at end of file From feaeb4fcecc3cdc359bdb9be8ff3a8c115e0189b Mon Sep 17 00:00:00 2001 From: badcommandorfilename Date: Wed, 13 Oct 2021 16:19:25 +1100 Subject: [PATCH 5/5] Updated DotNetNormalized arguments test --- .../Constructors/DotNetNormalizedArguments.Expected.txt | 4 ++-- .../Constructors/DotNetNormalizedArguments.ts | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Tests/EventHorizon.Blazor.TypeScript.Interop.Generator.Tests/GenerateClassStatementStringTests/Constructors/DotNetNormalizedArguments.Expected.txt b/Tests/EventHorizon.Blazor.TypeScript.Interop.Generator.Tests/GenerateClassStatementStringTests/Constructors/DotNetNormalizedArguments.Expected.txt index 60d958cd..10e78db9 100644 --- a/Tests/EventHorizon.Blazor.TypeScript.Interop.Generator.Tests/GenerateClassStatementStringTests/Constructors/DotNetNormalizedArguments.Expected.txt +++ b/Tests/EventHorizon.Blazor.TypeScript.Interop.Generator.Tests/GenerateClassStatementStringTests/Constructors/DotNetNormalizedArguments.Expected.txt @@ -46,12 +46,12 @@ namespace Examples } public ExampleClass( - string @ref, string @lock, string @unlock, string @object, string @event, string @bool, string @virtual + string @ref, string @lock, string @unlock, string @object, string @event, string @bool, string @virtual, string @string, string @params ) { var entity = EventHorizonBlazorInterop.New( new string[] { "Examples", "ExampleClass" }, - @ref, @lock, @unlock, @object, @event, @bool, @virtual + @ref, @lock, @unlock, @object, @event, @bool, @virtual, @string, @params ); ___guid = entity.___guid; } diff --git a/Tests/EventHorizon.Blazor.TypeScript.Interop.Generator.Tests/GenerateClassStatementStringTests/Constructors/DotNetNormalizedArguments.ts b/Tests/EventHorizon.Blazor.TypeScript.Interop.Generator.Tests/GenerateClassStatementStringTests/Constructors/DotNetNormalizedArguments.ts index 4a743e09..218a5882 100644 --- a/Tests/EventHorizon.Blazor.TypeScript.Interop.Generator.Tests/GenerateClassStatementStringTests/Constructors/DotNetNormalizedArguments.ts +++ b/Tests/EventHorizon.Blazor.TypeScript.Interop.Generator.Tests/GenerateClassStatementStringTests/Constructors/DotNetNormalizedArguments.ts @@ -6,6 +6,9 @@ declare module Examples { object: string, event: string, bool: string, - virtual: string); + virtual: string, + string: string, + params: string + ); } } \ No newline at end of file