diff options
Diffstat (limited to 'Source/Forms/Dialog.cs')
-rw-r--r-- | Source/Forms/Dialog.cs | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/Source/Forms/Dialog.cs b/Source/Forms/Dialog.cs new file mode 100644 index 0000000..1953816 --- /dev/null +++ b/Source/Forms/Dialog.cs @@ -0,0 +1,46 @@ +using System.Collections.Generic; +using System.Windows.Forms; + +namespace RehauSku.Forms +{ + static class Dialog + { + public static string GetFilePath() + { + string filePath = string.Empty; + + using (OpenFileDialog dialog = new OpenFileDialog()) + { + dialog.Filter = "Все файлы (*.*)|*.*"; + + if (dialog.ShowDialog() == DialogResult.OK) + { + filePath = dialog.FileName; + } + } + + return filePath; + } + + public static string[] GetMultiplyFiles() + { + List<string> fileNames = new List<string>(); + + using (OpenFileDialog dialog = new OpenFileDialog()) + { + dialog.Filter = "Все файлы (*.*)|*.*"; + dialog.Multiselect = true; + + if (dialog.ShowDialog() == DialogResult.OK) + { + foreach (string file in dialog.FileNames) + { + fileNames.Add(file); + } + } + } + + return fileNames.ToArray(); + } + } +} |