serializable class with nonserializable variables

i have a serializable class, but it contains a pointer to a nonserilaizable class.
is there a way to tell the compiler to ignore this when doing serialization/deserialization

or maybe there is a elegant work around for such a problem. i have an array of serializable objects which i need to point to non serialisable data.

i could iterate through each object in my array and serialize each one (currently i just write the whole array), this would require casting or converting to some base class/other class which sucks. Casting doesnt work as when i load in the data it would have to be converted any way
:-/


Answer this question

serializable class with nonserializable variables

  • mdoiron

    ah i worked it out :) just have a pointer to an object instead of what i actually want it to point to

  • Tim Rachel

    Depending on the serializer you're using, put the NonSerialized or XmlIgnore attribute on your variables/properties.

  • serializable class with nonserializable variables