Re: Code serialization order
- From: "Dira" <draiko@xxxxxxxxx>
- Date: 4 Nov 2005 01:41:59 -0800
Hello Arjun,
I'm afraid you should change something in the object design.
Not because it is invalid, but because MS/VS can not fitt all
imaginable requirements/wishes.
The VS Serializer (i suppose) considers
IComponents as serialization "roots". It starts with Components
and serializes recursively objects that are "used" by them.
An object is considered to be "used", if it is an argument of a ctor,
a value of a read/write property, a member of an ICollection, etc.
What "using" means can be specified more precise by different
attributes.
I do not understand the reason why the Serializer serializes
"object2" in your example. That is why i can hardly understand
what is "thinks" doing this and how to "convince" it to act
differently.
May it be, that "object2" is used by another component
(one different from "object1") ?
I suppose, there must be somewhere an "owner" of object2
that has a rank of a Component and serializing obvject2
is a consequence.
If I new more about your example.
Another idea were to implement all Wrappers as an extension
properties of some IExtenderProvider. In this case the VS Serializer
knows what to do and serializes in a correct order.
Regards,
Dima.
.
- References:
- Re: Code serialization order
- From: Dira
- Re: Code serialization order
- From: Arjun Singri
- Re: Code serialization order
- Prev by Date: Re: Code serialization order
- Next by Date: A custom IntegerUITypeEditor
- Previous by thread: Re: Code serialization order
- Next by thread: Replacing Custom Designer with post-build event
- Index(es):