public GUIMainController(GUIMainView view) { Serializer = new Serializer(this); Model = Serializer.Deserialize(); if(Model == null) Model = new GUIModel(); View = view; View.UpdateView(Model); }
/// <summary> /// Serializes the GUIModel /// </summary> /// <param name="model">The model to serialize</param> public void Serialize(GUIModel model) { XmlSerializer serializer = new XmlSerializer(typeof(GUIModel)); if(File.Exists(SAVE_PATH)) File.Delete(SAVE_PATH); FileStream stream = new FileStream(SAVE_PATH, FileMode.Create); serializer.Serialize(stream, model); stream.Close(); }