From 53c0b86582794c0837ecc6cbec66ef8d830d655b Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Wed, 16 Nov 2022 18:28:28 -0700 Subject: [PATCH] Add visibility modifier to struct properties Fixes #785 --- src/Microsoft.Windows.CsWin32/Generator.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.Windows.CsWin32/Generator.cs b/src/Microsoft.Windows.CsWin32/Generator.cs index 8293596c..1ad4c8ed 100644 --- a/src/Microsoft.Windows.CsWin32/Generator.cs +++ b/src/Microsoft.Windows.CsWin32/Generator.cs @@ -3611,7 +3611,9 @@ private TypeDeclarationSyntax DeclareInterfaceAsStruct(TypeDefinitionHandle type { PropertyDeclarationSyntax propertyDeclaration = PropertyDeclaration(propertyType.WithTrailingTrivia(Space), propertyName.Identifier.WithTrailingTrivia(LineFeed)); - propertyDeclaration = propertyDeclaration.WithAccessorList(AccessorList().AddAccessors(accessor)); + propertyDeclaration = propertyDeclaration + .WithAccessorList(AccessorList().AddAccessors(accessor)) + .AddModifiers(Token(this.Visibility)); if (propertyDeclaration.Type is PointerTypeSyntax) {