Re: Reflection and order of the fields
From: Nicholas Paldino [.NET/C# MVP] (mvp_at_spam.guard.caspershouse.com)
Date: 03/08/04
- Next message: Jon Skeet [C# MVP]: "Re: Reflection and order of the fields"
- Previous message: Elisa: "Re: Timezone"
- In reply to: Frank D Lombardo: "Reflection and order of the fields"
- Next in thread: Frank D Lombardo: "Re: Reflection and order of the fields"
- Reply: Frank D Lombardo: "Re: Reflection and order of the fields"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 8 Mar 2004 13:04:22 -0500
Frank,
I am curious, if you are sending an object over the wire, then why not
just use serialization (assuming that .NET is on the other side of the
wire).
The order of the fields is not guaranteed. Some reasonable assumptions
would be to get them in declarative order, and alphabetical, but I am not
sure. If you need a specific order, I would recommend getting the specific
fields and then ordering them yourself.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com
"Frank D Lombardo" <Frank@NoSpam.com> wrote in message
news:O8nyEXTBEHA.1548@TK2MSFTNGP12.phx.gbl...
> I am attempting to use Reflection to send an object over a serial port. I
> won't know the exact type of the object until run-time. If I call
> GetFields(), is there any guarantee on the order the fields are returned?
> Would it help if I used a struct instead of a class? I need to send the
> fields in a known and consistent order. I would also like this code to
work
> on the Compact Framework.
>
>
> Thanks,
> --
> Frank D. Lombardo
> Turning Point Technology, Inc.
> Frank_AT_TurningPointOnline_DOT_com
>
>
>
>
- Next message: Jon Skeet [C# MVP]: "Re: Reflection and order of the fields"
- Previous message: Elisa: "Re: Timezone"
- In reply to: Frank D Lombardo: "Reflection and order of the fields"
- Next in thread: Frank D Lombardo: "Re: Reflection and order of the fields"
- Reply: Frank D Lombardo: "Re: Reflection and order of the fields"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|