I am creating a chat application very basic. I establish the chat with a tcp connection. I often send serialized object through the network stream because it is simplier to program that way. anyways if I have a class person{ public string name{get;set;} }
then it will be eassy to serialize that class. when I include a public ImageSource Img {get;set;}
I am not able to serialize that class person any more.
the way I serialize is as:
Person p = new Person();
p.name = \some name
p.Img = \ some image
System.Xml.Serialization.XmlSerializer x = new System.Xml.Serialization.XmlSerializer(p.GetType());
x.Serialize(connection.stream, p);//here is when the problem comes. I am not able to serialize it if I include an Img
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…