From 994ed60dc0bfd534de78a0e0532a525192542f14 Mon Sep 17 00:00:00 2001 From: Dimitar Dobrev Date: Mon, 6 Jul 2015 09:56:30 +0300 Subject: [PATCH] Something went wrong and the actual fix for changed property access wasn't sent. Signed-off-by: Dimitar Dobrev --- .../Generators/CSharp/CSharpTextTemplate.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs index 47ce0d15..bf926067 100644 --- a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs +++ b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs @@ -1136,7 +1136,7 @@ namespace CppSharp.Generators.CSharp GenerateDeclarationCommon(prop); if (prop.ExplicitInterfaceImpl == null) { - Write(Helpers.GetAccess(prop.Access)); + Write(Helpers.GetAccess(GetValidPropertyAccess(prop))); if (prop.IsStatic) Write("static "); @@ -2188,6 +2188,18 @@ namespace CppSharp.Generators.CSharp } } + private static AccessSpecifier GetValidPropertyAccess(Property property) + { + switch (property.Access) + { + case AccessSpecifier.Public: + return AccessSpecifier.Public; + default: + return property.IsOverride ? + ((Class) property.Namespace).GetRootBaseProperty(property).Access : property.Access; + } + } + private void GenerateAbstractImplCall(Function function, Class @class) { string delegateId;