Hey there,
I want to save custom classes to file, so I need to pass a serialization. Those classes are mostly of Canvas, Line stuff, so I need an XML Serialization.
I have a custom class:
class Kanvas { Line l; Canvas c; double width; //... and so on public Kanvas() { c = new Canvas(); // so on } }
and I need to serialize a List<Kanvas> of those Kanvas objects.
Here's my serialization:
List<Kanvas> KK = new List<Kanvas>(); //filling KK with some Kanvas... System.IO.FileStream filestream = new System.IO.FileStream("D:\\file.txt", System.IO.FileMode.Create); XmlSerializer xm = new XmlSerializer(typeof(List<Kanvas>); xm.Serialize(filestream, KK); filestream.Close();
and I get an exception "There was an error reflecting type..." thrown. I did some searching and found that the problem is in line where XmlSerializer object is created. Maybe the typeof() ?
Please help!
Knowledge: C, C++, C#, Java, Pawn