H
hugo.braganca
Hi,
I need to iterate the Fields of given Structure though Reflection in
the same order they where declared.
Note that I only meet the Structure at Runtime.
'ex.:
Structure MyStruct
Dim Play As Byte
Dim Level As Byte
Dim Rate As Long
End Structure
Dim oMyStruct As New MyStruct
Dim Fields As Reflection.FieldInfo() = oMyStruct.GetType().GetFields()
Expected Order:
Fields.Item(0) = Play
Fields.Item(1) = Level
Fields.Item(2) = Rate
I'm using a class that was created based on the above assumption, and I
have the expected behaviour when I use it on the .net framework 1.1x;
but when I use it on the 2.0 framework the order of the fields become
random.
Does anyone know how to get the fields ordered at the declared manner ?
Thanks in advance
I need to iterate the Fields of given Structure though Reflection in
the same order they where declared.
Note that I only meet the Structure at Runtime.
'ex.:
Structure MyStruct
Dim Play As Byte
Dim Level As Byte
Dim Rate As Long
End Structure
Dim oMyStruct As New MyStruct
Dim Fields As Reflection.FieldInfo() = oMyStruct.GetType().GetFields()
Expected Order:
Fields.Item(0) = Play
Fields.Item(1) = Level
Fields.Item(2) = Rate
I'm using a class that was created based on the above assumption, and I
have the expected behaviour when I use it on the .net framework 1.1x;
but when I use it on the 2.0 framework the order of the fields become
random.
Does anyone know how to get the fields ordered at the declared manner ?
Thanks in advance