public void SaveToFile(string filename) { var settings = new DataContractSerializerSettings { PreserveObjectReferences = true }; var serializer = new DataContractSerializer(typeof(Project), settings); var xmlSettings = new XmlWriterSettings { Indent = true }; using (var file = XmlWriter.Create(new FileStream(filename, FileMode.Create), xmlSettings)) { serializer.WriteObject(file, this); } IsDirty = false; ProjectDirtied?.Invoke(IsDirty); }
public void MarkDirty() { IsDirty = true; ProjectDirtied?.Invoke(IsDirty); }