protected override bool ConfirmClose(IDocument document) { GameDocument gameDcument = document as GameDocument; if (gameDcument == null) { return(base.ConfirmClose(document)); } bool closeConfirmed = true; if (gameDcument.AnyDirty) { string message = "One or more level and/or external resource is dirty" + Environment.NewLine + "Save Changes?"; FileDialogResult result = FileDialogService.ConfirmFileClose(message); if (result == FileDialogResult.Yes) { closeConfirmed = Save(document); } else if (result == FileDialogResult.Cancel) { closeConfirmed = false; } } return(closeConfirmed); }
protected override bool ConfirmClose(IDocument document) { // <<XLE if (!LevelEditorXLE.Patches.ConfirmClose(document, FileDialogService)) { return(false); } // XLE>> GameDocument gameDcument = document as GameDocument; if (gameDcument == null) { return(base.ConfirmClose(document)); } bool closeConfirmed = true; if (m_gameDocumentRegistry.AnyDocumentDirty || m_gameDocumentRegistry.AnyEditableResourceOwnerDirty) { string message = "One or more level and/or external resource is dirty" + Environment.NewLine + "Save Changes?"; FileDialogResult result = FileDialogService.ConfirmFileClose(message); if (result == FileDialogResult.Yes) { closeConfirmed = Save(document); } else if (result == FileDialogResult.Cancel) { closeConfirmed = false; } } return(closeConfirmed); }