|
|
@ -143,8 +143,34 @@ namespace CppSharp.Passes |
|
|
|
{ |
|
|
|
{ |
|
|
|
foreach (var property in newProperties) |
|
|
|
foreach (var property in newProperties) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (property.IsOverride) |
|
|
|
ProcessOverridden(@class, property); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (property.GetMethod == null) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (property.SetMethod != null) |
|
|
|
|
|
|
|
property.SetMethod.GenerationKind = GenerationKind.Generate; |
|
|
|
|
|
|
|
@class.Properties.Remove(property); |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (property.SetMethod == null && |
|
|
|
|
|
|
|
@class.GetOverloads(property.GetMethod).Any( |
|
|
|
|
|
|
|
m => m != property.GetMethod && !m.Ignore)) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
property.GetMethod.GenerationKind = GenerationKind.Generate; |
|
|
|
|
|
|
|
@class.Properties.Remove(property); |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RenameConflictingMethods(@class, property); |
|
|
|
|
|
|
|
CombineComments(property); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static void ProcessOverridden(Class @class, Property property) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
if (!property.IsOverride) |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
Property baseProperty = GetBaseProperty(@class, property); |
|
|
|
Property baseProperty = GetBaseProperty(@class, property); |
|
|
|
if (baseProperty == null) |
|
|
|
if (baseProperty == null) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -161,27 +187,11 @@ namespace CppSharp.Passes |
|
|
|
} |
|
|
|
} |
|
|
|
else if (property.GetMethod == null && baseProperty.SetMethod != null) |
|
|
|
else if (property.GetMethod == null && baseProperty.SetMethod != null) |
|
|
|
property.GetMethod = baseProperty.GetMethod; |
|
|
|
property.GetMethod = baseProperty.GetMethod; |
|
|
|
else if (property.SetMethod == null) |
|
|
|
else if (property.SetMethod == null || baseProperty.SetMethod == null) |
|
|
|
property.SetMethod = baseProperty.SetMethod; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (property.GetMethod == null) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
if (property.SetMethod != null) |
|
|
|
if (property.SetMethod != null) |
|
|
|
property.SetMethod.GenerationKind = GenerationKind.Generate; |
|
|
|
property.SetMethod.GenerationKind = GenerationKind.Generate; |
|
|
|
@class.Properties.Remove(property); |
|
|
|
property.SetMethod = baseProperty.SetMethod; |
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (property.SetMethod == null && |
|
|
|
|
|
|
|
@class.GetOverloads(property.GetMethod).Any( |
|
|
|
|
|
|
|
m => m != property.GetMethod && !m.Ignore)) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
property.GetMethod.GenerationKind = GenerationKind.Generate; |
|
|
|
|
|
|
|
@class.Properties.Remove(property); |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RenameConflictingMethods(@class, property); |
|
|
|
|
|
|
|
CombineComments(property); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -191,8 +201,10 @@ namespace CppSharp.Passes |
|
|
|
{ |
|
|
|
{ |
|
|
|
Class baseClass = @base.Class.OriginalClass ?? @base.Class; |
|
|
|
Class baseClass = @base.Class.OriginalClass ?? @base.Class; |
|
|
|
Property baseProperty = baseClass.Properties.Find(p => |
|
|
|
Property baseProperty = baseClass.Properties.Find(p => |
|
|
|
(@override.GetMethod != null && @override.GetMethod.BaseMethod == p.GetMethod) || |
|
|
|
(@override.GetMethod?.IsOverride == true && |
|
|
|
(@override.SetMethod != null && @override.SetMethod.BaseMethod == p.SetMethod) || |
|
|
|
@override.GetMethod.BaseMethod == p.GetMethod) || |
|
|
|
|
|
|
|
(@override.SetMethod?.IsOverride == true && |
|
|
|
|
|
|
|
@override.SetMethod.BaseMethod == p.SetMethod) || |
|
|
|
(@override.Field != null && @override.Field == p.Field)); |
|
|
|
(@override.Field != null && @override.Field == p.Field)); |
|
|
|
if (baseProperty != null) |
|
|
|
if (baseProperty != null) |
|
|
|
return baseProperty; |
|
|
|
return baseProperty; |
|
|
|