I have this two codes and I wonder why Delphi version work and the other
(c#) don't work.
The c# compile tell me on this line :
AllSf.Item[i].Type_.Name
[C# Error] WinForm.cs(356):
'Borland.Eco.UmlRt.IStructuralFeatureCollection' don't contain a defination
for 'Item'
Any help will be apreciate.
Delphi code:
var
Cls: IClass;
AllSf : IStructuralFeatureCollection;
i: integer;
begin
Cls := IClass(EcoSpace.TypeSystem.AllClasses.GetItemByName("Person"));
AllSf := Cls.EcoClass.AllStructuralFeatures;
for i:= 0 to AllSF.Count - 1 do begin
if (AllSf.Item[i].Type_.Name = 'System.String') then ;
end;
end;
C# code:
Delphi code:
var
IClass Cls;
IStructuralFeatureCollection: AllSf;
int i;
{
Cls := (IClass) EcoSpace.TypeSystem.AllClasses.GetItemByName("Person");
AllSf := Cls.EcoClass.AllStructuralFeatures;
for (int i=0; i <= AllSf.Count - 1; i++) {
if (AllSf.Item[i].Type_.Name == 'System.String') ;
};
};
> AllSf.Item[i].Type_.Name
Try AllSf[i].Type_.Name instead - maybe it will help.