@ -203,8 +203,8 @@ namespace CppSharp.Generators.CSharp
@@ -203,8 +203,8 @@ namespace CppSharp.Generators.CSharp
// Generate all the enum declarations.
foreach ( var @enum in context . Enums )
{
if ( @enum . Ignore | | @enum . IsIncomplete )
{
if ( ! @enum . IsGenerated | | @enum . IsIncomplete )
continue ;
GenerateEnum ( @enum ) ;
@ -241,8 +241,8 @@ namespace CppSharp.Generators.CSharp
@@ -241,8 +241,8 @@ namespace CppSharp.Generators.CSharp
// Generate all the internal function declarations.
foreach ( var function in context . Functions )
{
if ( function . Ignore ) continue ;
{
if ( ! function . IsInternal ) continue ;
GenerateInternalFunction ( function ) ;
}
@ -251,8 +251,8 @@ namespace CppSharp.Generators.CSharp
@@ -251,8 +251,8 @@ namespace CppSharp.Generators.CSharp
PopBlock ( NewLineKind . BeforeNextBlock ) ;
foreach ( var function in context . Functions )
{
if ( function . Ignore ) continue ;
{
if ( ! function . IsGenerated ) continue ;
GenerateFunction ( function ) ;
}
@ -262,8 +262,8 @@ namespace CppSharp.Generators.CSharp
@@ -262,8 +262,8 @@ namespace CppSharp.Generators.CSharp
}
foreach ( var @event in context . Events )
{
if ( @event . Ignore ) continue ;
{
if ( ! @event . IsGenerated ) continue ;
GenerateEvent ( @event ) ;
}
@ -350,9 +350,9 @@ namespace CppSharp.Generators.CSharp
@@ -350,9 +350,9 @@ namespace CppSharp.Generators.CSharp
GenerateClassInternals ( @class ) ;
GenerateDeclContext ( @class ) ;
if ( @class . Ignore | | @class . IsDependent )
goto exit ;
if ( ! @class . IsGenerated | | @class . IsDependent )
goto exit ;
if ( ShouldGenerateClassNativeField ( @class ) )
{
PushBlock ( CSharpBlockKind . Field ) ;
@ -403,8 +403,8 @@ namespace CppSharp.Generators.CSharp
@@ -403,8 +403,8 @@ namespace CppSharp.Generators.CSharp
}
private void GenerateInterface ( Class @class )
{
if ( @class . Ignore | | @class . IsIncomplete )
{
if ( ! @class . IsGenerated | | @class . IsIncomplete )
return ;
PushBlock ( CSharpBlockKind . Interface ) ;
@ -432,8 +432,8 @@ namespace CppSharp.Generators.CSharp
@@ -432,8 +432,8 @@ namespace CppSharp.Generators.CSharp
WriteLine ( ");" ) ;
PopBlock ( NewLineKind . BeforeNextBlock ) ;
}
foreach ( var prop in @class . Properties . Where ( p = > ! p . Ignore ) )
}
foreach ( var prop in @class . Properties . Where ( p = > p . IsGenerated ) )
{
PushBlock ( CSharpBlockKind . Property ) ;
var type = prop . Type ;
@ -595,8 +595,8 @@ namespace CppSharp.Generators.CSharp
@@ -595,8 +595,8 @@ namespace CppSharp.Generators.CSharp
private void GenerateStructMarshalingProperties ( Class @class )
{
foreach ( var @base in @class . Bases )
{
if ( ! @base . IsClass | | @base . Class . Ignore )
{
if ( ! @base . IsClass | | ! @base . Class . IsGenerated )
continue ;
GenerateStructMarshalingProperties ( @base . Class ) ;
@ -604,8 +604,8 @@ namespace CppSharp.Generators.CSharp
@@ -604,8 +604,8 @@ namespace CppSharp.Generators.CSharp
for ( int i = 0 ; i < @class . Properties . Count ; i + + )
{
var property = @class . Properties [ i ] ;
if ( property . Ignore | | property . Field = = null ) continue ;
var property = @class . Properties [ i ] ;
if ( ! property . IsGenerated | | property . Field = = null ) continue ;
var nativeField = string . Format ( "{0}->{1}" ,
Generator . GeneratedIdentifier ( "ptr" ) ,
@ -646,8 +646,8 @@ namespace CppSharp.Generators.CSharp
@@ -646,8 +646,8 @@ namespace CppSharp.Generators.CSharp
private void GenerateStructInternalMarshalingProperties ( Class @class , string marshalVar )
{
foreach ( var @base in @class . Bases )
{
if ( ! @base . IsClass | | @base . Class . Ignore )
{
if ( ! @base . IsClass | | ! @base . Class . IsGenerated )
continue ;
var baseClass = @base . Class ;
@ -655,8 +655,8 @@ namespace CppSharp.Generators.CSharp
@@ -655,8 +655,8 @@ namespace CppSharp.Generators.CSharp
}
foreach ( var property in @class . Properties )
{
if ( property . Ignore | | property . Field = = null )
{
if ( ! property . IsGenerated | | property . Field = = null )
continue ;
GenerateStructInternalMarshalingProperty ( property , marshalVar ) ;
@ -710,7 +710,7 @@ namespace CppSharp.Generators.CSharp
@@ -710,7 +710,7 @@ namespace CppSharp.Generators.CSharp
baseClass = @class . Bases [ 0 ] . Class ;
var hasRefBase = baseClass ! = null & & baseClass . IsRefType
& & ! baseClass . ExplicityIgno red;
& & baseClass . IsDecla red;
return hasRefBase ;
}
@ -723,9 +723,9 @@ namespace CppSharp.Generators.CSharp
@@ -723,9 +723,9 @@ namespace CppSharp.Generators.CSharp
public void GenerateClassProlog ( Class @class )
{
if ( @class . IsUnion )
WriteLine ( "[StructLayout(LayoutKind.Explicit)]" ) ;
Write ( @class . Ignore ? "internal " : Helpers . GetAccess ( @class . Access ) ) ;
WriteLine ( "[StructLayout(LayoutKind.Explicit)]" ) ;
Write ( ! @class . IsGenerated ? "internal " : Helpers . GetAccess ( @class . Access ) ) ;
Write ( "unsafe " ) ;
if ( Driver . Options . GenerateAbstractImpls & & @class . IsAbstract )
@ -737,11 +737,11 @@ namespace CppSharp.Generators.CSharp
@@ -737,11 +737,11 @@ namespace CppSharp.Generators.CSharp
Write ( @class . IsInterface ? "interface " : ( @class . IsValueType ? "struct " : "class " ) ) ;
Write ( "{0}" , @class . Name ) ;
var bases = new List < string > ( ) ;
var needsBase = @class . HasBaseClass & & ! @class . IsValueType & & ! @class . Ignore
& & ! @class . Bases [ 0 ] . Class . IsValueType
& & ! @class . Bases [ 0 ] . Class . Ignore ;
var bases = new List < string > ( ) ;
var needsBase = @class . HasBaseClass & & ! @class . IsValueType & & @class . IsGenerated
& & ! @class . Bases [ 0 ] . Class . IsValueType
& & @class . Bases [ 0 ] . Class . IsGenerated ;
if ( needsBase )
{
@ -749,9 +749,9 @@ namespace CppSharp.Generators.CSharp
@@ -749,9 +749,9 @@ namespace CppSharp.Generators.CSharp
from @base in @class . Bases
where @base . IsClass
select QualifiedIdentifier ( @base . Class ) ) ;
}
if ( ! @class . Ignore )
}
if ( @class . IsGenerated )
{
if ( @class . IsRefType )
bases . Add ( "IDisposable" ) ;
@ -770,8 +770,8 @@ namespace CppSharp.Generators.CSharp
@@ -770,8 +770,8 @@ namespace CppSharp.Generators.CSharp
{
foreach ( var @base in @class . Bases . Where ( b = > ! ( b . Type is DependentNameType ) ) )
{
TypeMap typeMap ;
if ( ( ! Driver . TypeDatabase . FindTypeMap ( @base . Type , out typeMap ) & & @base . Class . Ignore ) | |
TypeMap typeMap ;
if ( ( ! Driver . TypeDatabase . FindTypeMap ( @base . Type , out typeMap ) & & ! @base . Class . IsGenerated ) | |
@base . Class . OriginalClass = = @class )
continue ;
@ -806,13 +806,13 @@ namespace CppSharp.Generators.CSharp
@@ -806,13 +806,13 @@ namespace CppSharp.Generators.CSharp
if ( field . Expression ! = null )
{
var fieldValuePrinted = field . Expression . CSharpValue ( ExpressionPrinter ) ;
Write ( "{0} {1} {2} = {3};" , field . Ignore ? "internal" : "public" ,
var fieldValuePrinted = field . Expression . CSharpValue ( ExpressionPrinter ) ;
Write ( "{0} {1} {2} = {3};" , ! field . IsGenerated ? "internal" : "public" ,
fieldTypePrinted . Type , safeIdentifier , fieldValuePrinted ) ;
}
else
{
Write ( "{0} {1} {2};" , field . Ignore ? "internal" : "public" ,
{
Write ( "{0} {1} {2};" , ! field . IsGenerated ? "internal" : "public" ,
fieldTypePrinted . Type , safeIdentifier ) ;
}
@ -1167,8 +1167,8 @@ namespace CppSharp.Generators.CSharp
@@ -1167,8 +1167,8 @@ namespace CppSharp.Generators.CSharp
public void GenerateClassVariables ( Class @class )
{
foreach ( var variable in @class . Variables )
{
if ( variable . Ignore ) continue ;
{
if ( ! variable . IsGenerated ) continue ;
if ( variable . Access ! = AccessSpecifier . Public )
continue ;
@ -1182,8 +1182,8 @@ namespace CppSharp.Generators.CSharp
@@ -1182,8 +1182,8 @@ namespace CppSharp.Generators.CSharp
private void GenerateClassProperties ( Class @class )
{
if ( @class . IsValueType )
{
foreach ( var @base in @class . Bases . Where ( b = > b . IsClass & & ! b . Class . Ignore ) )
{
foreach ( var @base in @class . Bases . Where ( b = > b . IsClass & & b . Class . IsGenerated ) )
{
GenerateClassProperties ( @base . Class ) ;
}
@ -1193,8 +1193,8 @@ namespace CppSharp.Generators.CSharp
@@ -1193,8 +1193,8 @@ namespace CppSharp.Generators.CSharp
}
private void GenerateProperties ( Class @class )
{
foreach ( var prop in @class . Properties . Where ( p = > ! p . Ignore ) )
{
foreach ( var prop in @class . Properties . Where ( p = > p . IsGenerated ) )
{
if ( prop . IsInRefTypeAndBackedByValueClassField ( ) )
{
@ -1513,8 +1513,8 @@ namespace CppSharp.Generators.CSharp
@@ -1513,8 +1513,8 @@ namespace CppSharp.Generators.CSharp
var marshals = new List < string > ( ) ;
for ( int i = 0 ; i < method . Parameters . Count ; i + + )
{
var param = method . Parameters [ i ] ;
if ( param . Ignore )
var param = method . Parameters [ i ] ;
if ( ! param . IsGenerated )
continue ;
if ( param . Kind = = ParameterKind . IndirectReturnType )
@ -1957,7 +1957,7 @@ namespace CppSharp.Generators.CSharp
@@ -1957,7 +1957,7 @@ namespace CppSharp.Generators.CSharp
private bool GenerateClassConstructorBase ( Class @class , Method method )
{
var hasBase = @class . HasBaseClass & & ! @class . Bases [ 0 ] . Class . Ignore ;
var hasBase = @class . HasBaseClass & & @class . Bases [ 0 ] . Class . IsGenerated ;
if ( hasBase & & ! @class . IsValueType )
{
@ -2528,8 +2528,8 @@ namespace CppSharp.Generators.CSharp
@@ -2528,8 +2528,8 @@ namespace CppSharp.Generators.CSharp
#endregion
public bool GenerateTypedef ( TypedefDecl typedef )
{
if ( typedef . Ignore )
{
if ( ! typedef . IsGenerated )
return false ;
GenerateDeclarationCommon ( typedef ) ;
@ -2562,8 +2562,8 @@ namespace CppSharp.Generators.CSharp
@@ -2562,8 +2562,8 @@ namespace CppSharp.Generators.CSharp
}
public void GenerateEnum ( Enumeration @enum )
{
if ( @enum . Ignore ) return ;
{
if ( ! @enum . IsGenerated ) return ;
PushBlock ( CSharpBlockKind . Enum ) ;
GenerateDeclarationCommon ( @enum ) ;
@ -2654,7 +2654,7 @@ namespace CppSharp.Generators.CSharp
@@ -2654,7 +2654,7 @@ namespace CppSharp.Generators.CSharp
public void GenerateInternalFunction ( Function function )
{
if ( function . ExplicityIgnored | | function . IsPure )
if ( ! function . IsInternal | | function . IsPure )
return ;
if ( function . OriginalFunction ! = null )