From 24024b5729c1c44bb01cb29813868743d1753e31 Mon Sep 17 00:00:00 2001 From: Sergey Chebotar Date: Fri, 24 Dec 2021 16:22:03 +0300 Subject: MergeTool, MemoryUtil anf stuff --- Source/Forms/Dialog.cs | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 Source/Forms/Dialog.cs (limited to 'Source/Forms/Dialog.cs') 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 fileNames = new List(); + + 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(); + } + } +} -- cgit v1.2.3 From 20cfbfcca3a779c04aecdca5e4b465651e2be42a Mon Sep 17 00:00:00 2001 From: Sergey Chebotar Date: Fri, 24 Dec 2021 17:42:20 +0300 Subject: New release --- Source/Forms/Dialog.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Source/Forms/Dialog.cs') diff --git a/Source/Forms/Dialog.cs b/Source/Forms/Dialog.cs index 1953816..170cc81 100644 --- a/Source/Forms/Dialog.cs +++ b/Source/Forms/Dialog.cs @@ -11,7 +11,7 @@ namespace RehauSku.Forms using (OpenFileDialog dialog = new OpenFileDialog()) { - dialog.Filter = "Все файлы (*.*)|*.*"; + dialog.Filter = "Файлы Excel (*.xls;*.xlsx;*.xlsm)|*.xls;*.xlsx;*.xlsm"; if (dialog.ShowDialog() == DialogResult.OK) { @@ -28,7 +28,7 @@ namespace RehauSku.Forms using (OpenFileDialog dialog = new OpenFileDialog()) { - dialog.Filter = "Все файлы (*.*)|*.*"; + dialog.Filter = "Файлы Excel (*.xls;*.xlsx;*.xlsm)|*.xls;*.xlsx;*.xlsm"; dialog.Multiselect = true; if (dialog.ShowDialog() == DialogResult.OK) -- cgit v1.2.3