From 3306d36ecbc024775972e5cf7971b2a7a70671d0 Mon Sep 17 00:00:00 2001 From: lempamo Date: Wed, 23 Aug 2017 13:38:40 -0400 Subject: Renaming the game! --- Histacom2.Engine/FileDialogBoxManager.cs | 40 ++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 Histacom2.Engine/FileDialogBoxManager.cs (limited to 'Histacom2.Engine/FileDialogBoxManager.cs') diff --git a/Histacom2.Engine/FileDialogBoxManager.cs b/Histacom2.Engine/FileDialogBoxManager.cs new file mode 100644 index 0000000..a862bc7 --- /dev/null +++ b/Histacom2.Engine/FileDialogBoxManager.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Histacom2.Engine +{ + public static class FileDialogBoxManager + { + public static bool IsInOpenDialog = false; + public static bool IsInSaveDialog = false; + public static string OnlyViewExtension = ""; + public static void ActivateOpenFileDialog(string ExtensionToView) + { + IsInOpenDialog = true; + IsInSaveDialog = false; + OnlyViewExtension = ExtensionToView; + } + + public static void ActivateSaveFileDialog(string ExtensionToView) + { + IsInOpenDialog = false; + IsInSaveDialog = true; + OnlyViewExtension = ExtensionToView; + } + + public static string ReadTextFile(string path) + { + try + { + return File.ReadAllText(path); + } catch { + return ""; + } + } + } +} -- cgit v1.2.3