[Mono-dev] serialization of structured data in ArrayList
Robert Jordan
robertj at gmx.net
Sun Dec 18 11:08:11 EST 2005
mirek wrote:
> hello
>
> i try to use serialization for storing of configuration in my app. the
> problem is, i've got some data stored in ArrayList, and they are not
> primitive types - they are instances of classes or some structs. so it
> looks like this:
>
> [Serializable]
> public class Entry
> {
> public string type;
> public int price;
> }
>
> [Serializable]
> public class CConfiguration
> {
> ...
> public ArrayList vehicle;
> ...
> }
>
> // in my app...
> Entry e = new Entry();
> e.type = "truck";
> e.price = 200;
>
> vehicle.Add( e );
>
> but it doesnt work. how can i do that?
What doesn't work? Did your get an exception? If so, which one?
Robert
More information about the Mono-devel-list
mailing list