aboutsummaryrefslogtreecommitdiff
path: root/src/Interface/Dialog.cs
diff options
context:
space:
mode:
authorSergey Chebotar <s.chebotar@gmail.com>2022-02-02 18:26:04 +0300
committerSergey Chebotar <s.chebotar@gmail.com>2022-02-02 18:26:04 +0300
commit9018d7d504dfebbec9a3c75851314d25d1e8197c (patch)
tree2755a90a7c614a5c3af9e63a419ff421d590a48e /src/Interface/Dialog.cs
parent94b7c4a52bc97026a9b24b7d703174f21f315912 (diff)
Edit Open File Dialogs
Diffstat (limited to 'src/Interface/Dialog.cs')
-rw-r--r--src/Interface/Dialog.cs17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/Interface/Dialog.cs b/src/Interface/Dialog.cs
index f8ab645..806e92d 100644
--- a/src/Interface/Dialog.cs
+++ b/src/Interface/Dialog.cs
@@ -8,25 +8,21 @@ namespace RehauSku.Interface
{
public static string GetFilePath()
{
- string filePath = string.Empty;
-
using (OpenFileDialog dialog = new OpenFileDialog())
{
dialog.Filter = "Файлы Excel (*.xls;*.xlsx;*.xlsm)|*.xls;*.xlsx;*.xlsm";
if (dialog.ShowDialog() == DialogResult.OK)
{
- filePath = dialog.FileName;
+ return dialog.FileName;
}
}
- return filePath;
+ return string.Empty;
}
public static string[] GetMultiplyFiles()
{
- List<string> fileNames = new List<string>();
-
using (OpenFileDialog dialog = new OpenFileDialog())
{
dialog.Filter = "Файлы Excel (*.xls;*.xlsx;*.xlsm)|*.xls;*.xlsx;*.xlsm";
@@ -34,14 +30,11 @@ namespace RehauSku.Interface
if (dialog.ShowDialog() == DialogResult.OK)
{
- foreach (string file in dialog.FileNames)
- {
- fileNames.Add(file);
- }
+ return dialog.FileNames;
}
- }
- return fileNames.ToArray();
+ else return null;
+ }
}
public static void SaveWorkbookAs()