From 47bc582eeb93ab98c3bd5bca96c2fd8eb8055e64 Mon Sep 17 00:00:00 2001 From: Peter <61538034+PTKu@users.noreply.github.com> Date: Thu, 19 Oct 2023 11:23:47 +0200 Subject: [PATCH] rcc now can render generics (disregards generic declaration) --- .../RenderableContentControl.razor.cs | 13 ++++++++++++- .../src/ixc/Properties/launchSettings.json | 3 ++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/AXSharp.blazor/src/AXSharp.Presentation.Blazor.Controls/RenderableContent/RenderableContentControl.razor.cs b/src/AXSharp.blazor/src/AXSharp.Presentation.Blazor.Controls/RenderableContent/RenderableContentControl.razor.cs index 3f606b74..c7c3e1c6 100644 --- a/src/AXSharp.blazor/src/AXSharp.Presentation.Blazor.Controls/RenderableContent/RenderableContentControl.razor.cs +++ b/src/AXSharp.blazor/src/AXSharp.Presentation.Blazor.Controls/RenderableContent/RenderableContentControl.razor.cs @@ -374,13 +374,24 @@ private IRenderableComponent GetComponent(Type twinType, ITwinElement twin, stri return primitiveComponent; } default: - var name = $"{namespc}.{twinType.Name}"; + var name = $"{namespc}.{FilterOutGeneric(twinType.Name)}"; var buildedComponentName = $"{name}{presentationName}View"; var defaultComponent = ComponentService.GetComponent(buildedComponentName); SubscribeForPolling(defaultComponent, twin); return defaultComponent; } } + + private string FilterOutGeneric(string twinTypeName) + { + int indexOfBacktick = twinTypeName.IndexOf('`'); + if (indexOfBacktick >= 0) + { + return twinTypeName.Substring(0, indexOfBacktick); + } + return twinTypeName; + } + private bool HasReadAccess(ITwinPrimitive kid) => kid.ReadWriteAccess == ReadWriteAccess.Read; private bool CheckForArray(ITwinObject twinObject) diff --git a/src/AXSharp.compiler/src/ixc/Properties/launchSettings.json b/src/AXSharp.compiler/src/ixc/Properties/launchSettings.json index 99ef86db..247c6538 100644 --- a/src/AXSharp.compiler/src/ixc/Properties/launchSettings.json +++ b/src/AXSharp.compiler/src/ixc/Properties/launchSettings.json @@ -10,7 +10,8 @@ }, "ixc-simple-template": { "commandName": "Project", - "workingDirectory": "C:\\W\\Develop\\gh\\ix-ax\\axopen\\src\\templates.simple\\ctrl\\" + "commandLineArgs": "-b", + "workingDirectory": "C:\\W\\Develop\\gh\\ix-ax\\axopen\\src\\templates.simple\\app\\" }, "ixc-template-ref": { "commandName": "Project",