static bool MarkAsSaved(SaveMultiModuleVM vm, LoadedAssembly[] asms) { bool setNewFileName = false; bool allSaved = true; foreach (var asm in asms) { if (!vm.WasSaved(asm.ModuleDefinition)) { allSaved = false; } else { UndoCommandManager.Instance.MarkAsSaved(asm); if (string.IsNullOrEmpty(asm.FileName)) { var filename = vm.GetSavedFileName(asm.ModuleDefinition); if (!string.IsNullOrWhiteSpace(filename)) { asm.ModuleDefinition.Location = filename; asm.FileName = filename; setNewFileName = true; var asmNode = MainWindow.Instance.FindTreeNode(asm.ModuleDefinition) as AssemblyTreeNode; Debug.Assert(asmNode != null); if (asmNode != null) { asmNode.OnFileNameChanged(); Utils.NotifyModifiedAssembly(asm); } } } } } if (setNewFileName) { MainWindow.Instance.CurrentAssemblyList.RefreshSave(); } return(allSaved); }
static bool MarkAsSaved(SaveMultiModuleVM vm, LoadedAssembly[] asms) { bool setNewFileName = false; bool allSaved = true; foreach (var asm in asms) { if (!vm.WasSaved(asm.ModuleDefinition)) allSaved = false; else { UndoCommandManager.Instance.MarkAsSaved(asm); if (string.IsNullOrEmpty(asm.FileName)) { var filename = vm.GetSavedFileName(asm.ModuleDefinition); if (!string.IsNullOrWhiteSpace(filename)) { asm.ModuleDefinition.Location = filename; asm.FileName = filename; setNewFileName = true; var asmNode = MainWindow.Instance.FindTreeNode(asm.ModuleDefinition) as AssemblyTreeNode; Debug.Assert(asmNode != null); if (asmNode != null) { asmNode.OnFileNameChanged(); Utils.NotifyModifiedAssembly(asm); } } } } } if (setNewFileName) MainWindow.Instance.CurrentAssemblyList.RefreshSave(); return allSaved; }