matahijau Posted December 7, 2004 Posted December 7, 2004 I have a class MyForm : System.Windows.Forms.Form which I have marked as Serializable and I made implement ISerializable. It contains one instance of a class MyPanel : System.Windows.Forms.Panel, also implementing ISerializable. There is one more level of containment, as the MyPanel class contains one instance of a class MyPicBox : System.Windows.Forms.PictureBox (also implementing ISerializable). So containment is illustrated by� MyForm > MyPanel > MyPicBox The instance of MyPicBox contains a string and an Image which I want to serialize. How do I do this? I know the specifics that are common to a normal serialization process (like using a formatter). It�s the hierarchal containment that is confusing me. The serialization process must start in MyForm, even though there is really nothing to serialize until we burrow down into MyPicBox. I can�t just stick the [serializable] attribute on each class and let if fly because they inherit from nonserializable base classes of the Framework. If you have any insight I would greatly appreciate your advice. Thanks! Collin Lourie Quote
Administrators PlausiblyDamp Posted December 8, 2004 Administrators Posted December 8, 2004 How are you implementing ISerializable in each of the classes? If the MyPicBox implements ISerializable then you should be able to call it's implementation from the MyPanel's implementation to simply delegate the task down to the nested members. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.