public static void LoadWorkspace() { WorkspacePathEventArgs args = new WorkspacePathEventArgs(null, false); AskSavePathWorkspace?.Invoke(null, args); if (!string.IsNullOrEmpty(args.Path)) { LoadWorkspace(args.Path); } }
public void SaveWorkspace() { if (string.IsNullOrEmpty(this.currentFilePath)) { WorkspacePathEventArgs args = new WorkspacePathEventArgs(this, true); AskSavePathWorkspace?.Invoke(null, args); if (string.IsNullOrEmpty(args.Path)) { throw new ArgumentException("Path"); } this.currentFilePath = args.Path; } using (Stream stream = new FileStream(this.currentFilePath, FileMode.Create)) { //stream. XmlSerializer serializer = new XmlSerializer(typeof(StorageContainer)); serializer.Serialize(stream, this.storageContainer); SetHasChanges(false); } }