Quantcast
Channel: Serialize class to XML? - Stack Overflow
Viewing all articles
Browse latest Browse all 3

Serialize class to XML?

$
0
0

I have the follow class and the list that holds it:

public class Transport{    public string TransportType { get; set; }    public string Mode { get; set; }    public class Coordinates    {        public float ID { get; set; }        public float LocX { get; set; }        public float LocY { get; set; }        public float LocZ { get; set; }        public ObjectState State { get; set; }        public List<int[]> Connections = new <int[]>();    }}public enum ObjectState{    Fly,    Ground,    Water}public static List<Transport> Tracking = new List<Transport>();

How do I serialize the Tracking to XML ?

I know I can use [Serializable] on the list and serialize it to file but I am not sure on how I define it to be saved as XML.


Viewing all articles
Browse latest Browse all 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>