Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Work in Delphi don't work in c# Why?

1 view
Skip to first unread message

Daniel Lodeiro

unread,
Nov 2, 2005, 1:02:36 PM11/2/05
to
Hello all

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') ;
};
};


Dmitriy Nagirnyak

unread,
Mar 14, 2006, 7:57:37 AM3/14/06
to
Hello Daniel,


> AllSf.Item[i].Type_.Name
Try AllSf[i].Type_.Name instead - maybe it will help.


0 new messages