Browse Source

Do not use safeIdentifier id to store the full type name (refactoring).

pull/547/head
triton 10 years ago
parent
commit
4db4bfa567
  1. 7
      src/Generator/Generators/CSharp/CSharpTextTemplate.cs

7
src/Generator/Generators/CSharp/CSharpTextTemplate.cs

@ -729,18 +729,19 @@ namespace CppSharp.Generators.CSharp @@ -729,18 +729,19 @@ namespace CppSharp.Generators.CSharp
var fieldTypePrinted = field.QualifiedType.CSharpType(TypePrinter);
var typeName = safeIdentifier;
if (!string.IsNullOrWhiteSpace(fieldTypePrinted.NameSuffix))
safeIdentifier += fieldTypePrinted.NameSuffix;
typeName += fieldTypePrinted.NameSuffix;
var access = @class != null && !@class.IsGenerated ? "internal" : "public";
if (field.Expression != null)
{
var fieldValuePrinted = field.Expression.CSharpValue(ExpressionPrinter);
Write("{0} {1} {2} = {3};", access, fieldTypePrinted.Type, safeIdentifier, fieldValuePrinted);
Write("{0} {1} {2} = {3};", access, fieldTypePrinted.Type, typeName, fieldValuePrinted);
}
else
{
Write("{0} {1} {2};", access, fieldTypePrinted.Type, safeIdentifier);
Write("{0} {1} {2};", access, fieldTypePrinted.Type, typeName);
}
PopBlock(NewLineKind.BeforeNextBlock);

Loading…
Cancel
Save