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