Deserialization question
-
Hi, i have a little quiestion, about deserializing a custom type...I want to deserialized this custom type but actually i dont know it. What i mean is for example i have a type called TypeA - i serialized it. But when i want to deserialized i dont know what type i have at the xml file(for xml serialization). I want to find it out. Is there way to find what type i have?
-
Hi, i have a little quiestion, about deserializing a custom type...I want to deserialized this custom type but actually i dont know it. What i mean is for example i have a type called TypeA - i serialized it. But when i want to deserialized i dont know what type i have at the xml file(for xml serialization). I want to find it out. Is there way to find what type i have?
One option would be to serialize as part of the object the Type's FullName.
this.GetType().FullName
This wont help you on "automatically" deserializing that object, but you could directly interrogate the Xml to determine what the type was of the serialized object. -
Hi, i have a little quiestion, about deserializing a custom type...I want to deserialized this custom type but actually i dont know it. What i mean is for example i have a type called TypeA - i serialized it. But when i want to deserialized i dont know what type i have at the xml file(for xml serialization). I want to find it out. Is there way to find what type i have?
Sorry, I am a beginer, is there any article to understand serialization. Thanks, h.
-
Sorry, I am a beginer, is there any article to understand serialization. Thanks, h.
Yes there is. Search on codeproject
#region signature my articles #endregion
-
Hi, i have a little quiestion, about deserializing a custom type...I want to deserialized this custom type but actually i dont know it. What i mean is for example i have a type called TypeA - i serialized it. But when i want to deserialized i dont know what type i have at the xml file(for xml serialization). I want to find it out. Is there way to find what type i have?
The only solution I know is to store the type during serialization. When deserializing, first deserialize the type description and deserialize the object afterwards, using a switch statement for the type to deserialize. It took me a lot of time to find out how to do it. I will write an article about this subject for codeproject. I think it may be ready somewhere next week.
Rudolf Heijink
-
The only solution I know is to store the type during serialization. When deserializing, first deserialize the type description and deserialize the object afterwards, using a switch statement for the type to deserialize. It took me a lot of time to find out how to do it. I will write an article about this subject for codeproject. I think it may be ready somewhere next week.
Rudolf Heijink