diff options
| author | lempamo <[email protected]> | 2017-05-30 21:35:05 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2017-05-30 21:35:05 -0400 |
| commit | 13cd6b245ca3104589333295ebc22bf9a659562d (patch) | |
| tree | 263fc78c63ecf16a46fc760bfe73280cdc8fc0c7 /TimeHACK.Engine/FileDialogBoxManager.cs | |
| parent | 79808fce9199840ad4627ee1aecb8f7430ab6b6c (diff) | |
| parent | 9ee1762d7261de1e7c98862fc91abd52deb6f8b9 (diff) | |
| download | histacom2-13cd6b245ca3104589333295ebc22bf9a659562d.tar.gz histacom2-13cd6b245ca3104589333295ebc22bf9a659562d.tar.bz2 histacom2-13cd6b245ca3104589333295ebc22bf9a659562d.zip | |
Merge pull request #2 from TimeHACKDevs/master
Merge
Diffstat (limited to 'TimeHACK.Engine/FileDialogBoxManager.cs')
| -rw-r--r-- | TimeHACK.Engine/FileDialogBoxManager.cs | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/TimeHACK.Engine/FileDialogBoxManager.cs b/TimeHACK.Engine/FileDialogBoxManager.cs new file mode 100644 index 0000000..334ebdd --- /dev/null +++ b/TimeHACK.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 TimeHACK.Engine +{ + public static class FileDialogBoxManager + { + public static Boolean IsInOpenDialog = false; + public static Boolean 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 ""; + } + } + } +} |
