main
1using System.Windows.Forms;
2using Gorilla.Commons.Infrastructure.FileSystem;
3using momoney.presentation.views;
4
5namespace MoMoney.Presentation.Winforms.Views
6{
7 public class SelectFileToSaveToDialog : ISelectFileToSaveToDialog
8 {
9 readonly FileDialog dialog;
10 readonly IWin32Window window;
11
12 public SelectFileToSaveToDialog(IWin32Window window)
13 {
14 dialog = new SaveFileDialog {Filter = "My Money Files (*.mo)|*.mo"};
15 this.window = window;
16 }
17
18 public File tell_me_the_path_to_the_file()
19 {
20 var result = dialog.ShowDialog(window);
21 var the_path = (ApplicationFile) (result == DialogResult.Cancel ? string.Empty : dialog.FileName);
22 dialog.Dispose();
23 return the_path;
24 }
25 }
26}