public async Task <FileExistCheckResult> CheckIfFileExistsWithResultInOverlay(Job job, string latestConfirmedPath) { var filePath = job.OutputFileTemplate; //Do not inform user, if SaveFileDialog already did if (filePath == latestConfirmedPath) { return(new FileExistCheckResult(true, latestConfirmedPath)); } if (job.Profile.SaveFileTemporary || !_file.Exists(filePath)) { return(new FileExistCheckResult(true, latestConfirmedPath)); } _translation = _translationFactory.UpdateOrCreateTranslation(_translation); var title = _translation.ConfirmSaveAs.ToUpper(CultureInfo.CurrentCulture); var text = _translation.GetFileAlreadyExists(filePath); var interaction = new MessageInteraction(text, title, MessageOptions.YesNo, MessageIcon.Exclamation); var result = await _interactionRequest.RaiseAsync(interaction); if (result.Response == MessageResponse.Yes) { return(new FileExistCheckResult(true, filePath)); } return(new FileExistCheckResult(false, "")); }
private MessageInteraction BuildInteraction(Job job, ActionResult profileCheckResult) { _translation = _translationFactory.UpdateOrCreateTranslation(_translation); var title = _translation.Error; var text = _translation.InvalidSettings; var interaction = new MessageInteraction(text, title, MessageOptions.OK, MessageIcon.Exclamation, job.Profile.Name, profileCheckResult); interaction.ShowErrorRegions = false; return(interaction); }