fix: passthrough should point to polonium registry

This commit is contained in:
h z
2025-02-20 09:31:11 +00:00
parent f70cab525b
commit 607d5cb6a5

View File

@@ -29,6 +29,7 @@ public class GenerateRegistryPassThrough : PoloniumTask
foreach (string use in GetUsings(code)) foreach (string use in GetUsings(code))
sb.AppendLine(use); sb.AppendLine(use);
sb sb
.AppendLine("using System.Collections.Generic;")
.AppendLine("// ReSharper disable once CheckNamespace") .AppendLine("// ReSharper disable once CheckNamespace")
.AppendLine("public static partial class GlobalRegistry") .AppendLine("public static partial class GlobalRegistry")
.AppendLine("{"); .AppendLine("{");
@@ -47,14 +48,14 @@ public class GenerateRegistryPassThrough : PoloniumTask
foreach (PropertyDeclarationSyntax property in properties) foreach (PropertyDeclarationSyntax property in properties)
{ {
if (HasGetterOnly(property)) if (HasGetterOnly(property))
sb.AppendLine($" public static {GetDisplayName(property.Type)} {property.Identifier.ToString()} => GlobalRegistry.{property.Identifier.ValueText};"); sb.AppendLine($" public static {GetDisplayName(property.Type)} {property.Identifier.ToString()} => PoloniumRegistry.{property.Identifier.ValueText};");
else else
{ {
sb sb
.AppendLine($" public static {GetDisplayName(property.Type)} {property.Identifier.ToString()}") .AppendLine($" public static {GetDisplayName(property.Type)} {property.Identifier.ToString()}")
.AppendLine(" {") .AppendLine(" {")
.AppendLine($" get => GlobalRegistry.{property.Identifier.ValueText};") .AppendLine($" get => PoloniumRegistry.{property.Identifier.ValueText};")
.AppendLine($" set => GlobalRegistry.{property.Identifier.ValueText} = value;") .AppendLine($" set => PoloniumRegistry.{property.Identifier.ValueText} = value;")
.AppendLine(" }"); .AppendLine(" }");
} }
} }