aboutsummaryrefslogtreecommitdiff
path: root/TimeHACK.Engine/FileDialogBoxManager.cs
diff options
context:
space:
mode:
authorAlex-TIMEHACK <[email protected]>2017-08-27 11:32:44 +0100
committerAlex-TIMEHACK <[email protected]>2017-08-27 11:32:44 +0100
commitf8f3bd0b1eb57c5a289513200b192e1d54d58292 (patch)
treec9b79515fb81d90320ef386a522a5830875f6d49 /TimeHACK.Engine/FileDialogBoxManager.cs
parentbffcb720f811623015ed4795032e5c57d1064c8a (diff)
parentcd6273d7c95098e0e0dd9948c6b5cec1c5f9cd3f (diff)
downloadhistacom2-f8f3bd0b1eb57c5a289513200b192e1d54d58292.tar.gz
histacom2-f8f3bd0b1eb57c5a289513200b192e1d54d58292.tar.bz2
histacom2-f8f3bd0b1eb57c5a289513200b192e1d54d58292.zip
Updated my fork!
Diffstat (limited to 'TimeHACK.Engine/FileDialogBoxManager.cs')
-rw-r--r--TimeHACK.Engine/FileDialogBoxManager.cs55
1 files changed, 0 insertions, 55 deletions
diff --git a/TimeHACK.Engine/FileDialogBoxManager.cs b/TimeHACK.Engine/FileDialogBoxManager.cs
deleted file mode 100644
index 59533fa..0000000
--- a/TimeHACK.Engine/FileDialogBoxManager.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-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 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 "";
- }
- }
-
- public static void SaveRtfDocument(RichTextBox tbox, string path)
- {
- int fileBytes = 0;
- tbox.SaveFile(path);
- fileBytes = File.ReadAllText(path).Length;
-
- THFileInfo info = new THFileInfo();
- info.Name = Path.GetFileName(path);
- info.FileIcon = 17;
- info.ByteSize = fileBytes;
- SaveSystem.CurrentSave.BytesLeft -= fileBytes;
- SaveSystem.UpdateDirectoryInfo(new FileInfo(path).Directory.FullName, info);
- }
- }
-}