public void ProcessResult(Result <Bitmap> resultOfBitmap, string filePath, ImageFormat imageFormat) { if (resultOfBitmap.IsSuccess) { var bitmap = resultOfBitmap.GetValueOrThrow(); Result.OfAction(() => imageSaver.SaveBitmap(bitmap, filePath, imageFormat)) .RefineError("Failed to save result") .Then(none => resultDisplay.ShowResult(bitmap)) .OnFail(error => resultDisplay.ShowError(error)); } else { resultDisplay.ShowError(resultOfBitmap.Error); } }