Skip to content

Commit

Permalink
Fix [GenerateTypedNameReferences] with sealed types.
Browse files Browse the repository at this point in the history
  • Loading branch information
PJB3005 committed Feb 16, 2021
1 parent 7162ca3 commit 6ae0b0e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Robust.Client.NameGenerator/XamlUiPartialClassGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,10 @@ private static string GenerateSourceCode(
compiler.Transform(parsed);
var initialRoot = (XamlAstObjectNode) parsed.Root;
var names = NameVisitor.GetNames(initialRoot);
var fieldAccess = classSymbol.IsSealed ? "private" : "protected";
//var names = NameVisitor.GetNames((XamlAstObjectNode)XDocumentXamlParser.Parse(xamlFile).Root);
var namedControls = names.Select(info => " " +
$"protected global::{info.type} {info.name} => " +
$"{fieldAccess} global::{info.type} {info.name} => " +
$"this.FindControl<global::{info.type}>(\"{info.name}\");");
return $@"// <auto-generated />
using Robust.Client.UserInterface;
Expand Down

0 comments on commit 6ae0b0e

Please sign in to comment.