From 9acb394d30ce553db0b54dba93cf07310ab895ef Mon Sep 17 00:00:00 2001 From: Mark van Renswoude Date: Wed, 3 Jul 2013 14:53:48 +0000 Subject: [PATCH] Fixed enumerator data type name --- Units/DelphiXMLDataBindingGenerator.pas | 8 +++++--- Units/DelphiXMLDataBindingResources.pas | 12 ++++++------ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Units/DelphiXMLDataBindingGenerator.pas b/Units/DelphiXMLDataBindingGenerator.pas index 6159f65..937bfd6 100644 --- a/Units/DelphiXMLDataBindingGenerator.pas +++ b/Units/DelphiXMLDataBindingGenerator.pas @@ -1631,12 +1631,14 @@ begin if not AItem.IsCollection then Exit; + + case ASection of dxsInterface: begin AStream.WriteLnNamedFmt(EnumeratorInterface, ['Name', AItem.TranslatedName, - 'ItemName', AItem.CollectionItem.TranslatedName, + 'DataType', GetDataTypeName(AItem.CollectionItem, True), 'GUID', CreateNewGUID]); AStream.WriteLn(''); end; @@ -1645,7 +1647,7 @@ begin begin AStream.WriteLnNamedFmt(EnumeratorClass, ['Name', AItem.TranslatedName, - 'ItemName', AItem.CollectionItem.TranslatedName]); + 'DataType', GetDataTypeName(AItem.CollectionItem, True)]); AStream.WriteLn(''); end; @@ -1653,7 +1655,7 @@ begin begin AStream.WriteLnNamedFmt(EnumeratorImplementation, ['Name', AItem.TranslatedName, - 'ItemName', AItem.CollectionItem.TranslatedName]); + 'DataType', GetDataTypeName(AItem.CollectionItem, True)]); end; end; end; diff --git a/Units/DelphiXMLDataBindingResources.pas b/Units/DelphiXMLDataBindingResources.pas index 90abc0d..0c4e34a 100644 --- a/Units/DelphiXMLDataBindingResources.pas +++ b/Units/DelphiXMLDataBindingResources.pas @@ -98,7 +98,7 @@ const XSDValidateMethodImplementationEnd = 'end;' + CrLf; - EnumeratorMethodInterface = ' function GetEnumerator: IXML%:sEnumerator;'; + EnumeratorMethodInterface = ' function GetEnumerator: %:sEnumerator;'; EnumeratorMethodImplementation = 'function TXML%:s.GetEnumerator: IXML%:sEnumerator;' + CrLf + 'begin' + CrLf + ' Result := TXML%:sEnumerator.Create(Self);' + CrLf + @@ -107,20 +107,20 @@ const EnumeratorInterface = ' IXML%:sEnumerator = interface' + CrLf + ' %:s' + CrLf + - ' function GetCurrent: IXML%:s;' + CrLf + + ' function GetCurrent: %:s;' + CrLf + ' function MoveNext: Boolean;' + CrLf + - ' property Current: IXML%:s read GetCurrent;' + CrLf + + ' property Current: %:s read GetCurrent;' + CrLf + ' end;' + CrLf; EnumeratorClass = ' TXML%:sEnumerator = class(TXMLNodeCollectionEnumerator, IXML%:sEnumerator)' + CrLf + ' protected' + CrLf + - ' function GetCurrent: IXML%:s;' + CrLf + + ' function GetCurrent: %:s;' + CrLf + ' end;' + CrLf; - EnumeratorImplementation = 'function TXML%:sEnumerator.GetCurrent: IXML%:s;' + CrLf + + EnumeratorImplementation = 'function TXML%:sEnumerator.GetCurrent: %:s;' + CrLf + 'begin' + CrLf + - ' Result := (inherited GetCurrent as IXML%:s);' + CrLf + + ' Result := (inherited GetCurrent as %:s);' + CrLf + 'end;' + CrLf; PropertyIntfMethodGetOptional = ' function GetHas%:s: Boolean;';