/** * TODO: implement BinaryWriter/Reader * public static void serializeBinary(string path, Veranstaltung lv) { } public static Veranstaltung deserializeBinary(string path) { }*/ public static void serializeXml(string path, Veranstaltung lv) { XmlSerializer xmlSer = new XmlSerializer(typeof(Veranstaltung)); FileStream fileStream = new FileStream(path, FileMode.Create); xmlSer.Serialize(fileStream, lv); fileStream.Close(); }
public static void serializeBinaryFormatter(string path, Veranstaltung lv) { BinaryFormatter binFor = new BinaryFormatter(); FileStream fileStream = new FileStream(path, FileMode.Create); binFor.Serialize(fileStream, lv); fileStream.Close(); }