@ -353,7 +353,7 @@ namespace CppSharp.Generators.CSharp
@@ -353,7 +353,7 @@ namespace CppSharp.Generators.CSharp
public void GenerateClass ( Class @class )
{
if ( ! @class . IsGenerated | | @class . IsIncomplete )
if ( @class . IsIncomplete )
return ;
PushBlock ( CSharpBlockKind . Class ) ;
@ -370,7 +370,7 @@ namespace CppSharp.Generators.CSharp
@@ -370,7 +370,7 @@ namespace CppSharp.Generators.CSharp
GenerateClassInternals ( @class ) ;
GenerateDeclContext ( @class ) ;
if ( @class . IsDependent )
if ( @class . IsDependent | | ! @class . IsGenerated )
goto exit ;
if ( ShouldGenerateClassNativeField ( @class ) )
@ -720,14 +720,15 @@ namespace CppSharp.Generators.CSharp
@@ -720,14 +720,15 @@ namespace CppSharp.Generators.CSharp
if ( ! string . IsNullOrWhiteSpace ( fieldTypePrinted . NameSuffix ) )
safeIdentifier + = fieldTypePrinted . NameSuffix ;
var access = @class ! = null & & ! @class . IsGenerated ? "internal" : "public" ;
if ( field . Expression ! = null )
{
var fieldValuePrinted = field . Expression . CSharpValue ( ExpressionPrinter ) ;
Write ( "public {0} {1} = {2};" , fieldTypePrinted . Type , safeIdentifier , fieldValuePrinted ) ;
Write ( "{0} {1} {2} = {3};" , access , fieldTypePrinted . Type , safeIdentifier , fieldValuePrinted ) ;
}
else
{
Write ( "public {0} {1};" , fieldTypePrinted . Type , safeIdentifier ) ;
Write ( "{0} {1} {2} ;" , access , fieldTypePrinted . Type , safeIdentifier ) ;
}
PopBlock ( NewLineKind . BeforeNextBlock ) ;