diff options
| author | lempamo <[email protected]> | 2017-08-27 15:46:36 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2017-08-27 15:46:36 -0400 |
| commit | d2006a3cf629c0ac4ec020778604ae490b4981ec (patch) | |
| tree | 6306b7fdc0dbe4b42e27296d5d74e5787fbc8146 /Histacom2.Engine/FileDialogBoxManager.cs | |
| parent | e5f6f8ddc11ac1a17abc98b006ddff5860e0e805 (diff) | |
| parent | 805a238822d3fdca7b75f63e622d93cba421755a (diff) | |
| download | histacom2-d2006a3cf629c0ac4ec020778604ae490b4981ec.tar.gz histacom2-d2006a3cf629c0ac4ec020778604ae490b4981ec.tar.bz2 histacom2-d2006a3cf629c0ac4ec020778604ae490b4981ec.zip | |
Merge pull request #152 from Alex-TIMEHACK/master
Wordpad saves files + Windows Explorer overhawl
Diffstat (limited to 'Histacom2.Engine/FileDialogBoxManager.cs')
| -rw-r--r-- | Histacom2.Engine/FileDialogBoxManager.cs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Histacom2.Engine/FileDialogBoxManager.cs b/Histacom2.Engine/FileDialogBoxManager.cs index a862bc7..161c393 100644 --- a/Histacom2.Engine/FileDialogBoxManager.cs +++ b/Histacom2.Engine/FileDialogBoxManager.cs @@ -13,6 +13,7 @@ namespace Histacom2.Engine public static bool IsInOpenDialog = false; public static bool IsInSaveDialog = false; public static string OnlyViewExtension = ""; + public static void ActivateOpenFileDialog(string ExtensionToView) { IsInOpenDialog = true; @@ -36,5 +37,19 @@ namespace Histacom2.Engine 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 = 20; + info.ByteSize = fileBytes; + SaveSystem.CurrentSave.BytesLeft -= fileBytes; + SaveSystem.UpdateDirectoryInfo(new FileInfo(path).Directory.FullName, info); + } } } |
