public void SaveChunck(Chunck chunck) { try { XmlSerializer xmlSerializer = new XmlSerializer(this.GetType()); xmlSerializer.Serialize(new StreamWriter(chunck.FileDirectory + chunck.FileName), chunck); } catch (Exception e) { Log.Messages.Add(e.Message); } }
public void OpenChunck(Chunck chunck) { try { XmlSerializer xmlSerializer = new XmlSerializer(this.GetType()); chunck = xmlSerializer.Deserialize(new StreamReader(chunck.FileDirectory + chunck.FileName)) as Chunck; } catch (Exception e) { Log.Messages.Add(e.Message); } }