diff options
| author | Alex-TIMEHACK <[email protected]> | 2017-08-18 14:56:56 +0100 |
|---|---|---|
| committer | Alex-TIMEHACK <[email protected]> | 2017-08-18 14:56:56 +0100 |
| commit | 414133b35d39b84537f4375e27e3e5f206655c5a (patch) | |
| tree | a7faf10e39c8fa34cad39a7b1261d793ba4bbee9 /TimeHACK.Engine | |
| parent | 3399ab978ca11faee44803d2b7c5f0f06855504a (diff) | |
| download | histacom2-414133b35d39b84537f4375e27e3e5f206655c5a.tar.gz histacom2-414133b35d39b84537f4375e27e3e5f206655c5a.tar.bz2 histacom2-414133b35d39b84537f4375e27e3e5f206655c5a.zip | |
Quite Big revamp on Explorer Part 1
Diffstat (limited to 'TimeHACK.Engine')
| -rw-r--r-- | TimeHACK.Engine/FileDialogBoxManager.cs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/TimeHACK.Engine/FileDialogBoxManager.cs b/TimeHACK.Engine/FileDialogBoxManager.cs index f6d30ae..3bffe30 100644 --- a/TimeHACK.Engine/FileDialogBoxManager.cs +++ b/TimeHACK.Engine/FileDialogBoxManager.cs @@ -13,6 +13,7 @@ namespace TimeHACK.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,28 @@ namespace TimeHACK.Engine return ""; } } + + public static void SaveTextFile(string path, string contents, int fileIcon) + { + try + { + File.WriteAllText(path, contents); + FileSystemFolderInfo theDir = Newtonsoft.Json.JsonConvert.DeserializeObject<FileSystemFolderInfo>(File.ReadAllText(Path.Combine(Path.GetPathRoot(path), "_data.info"))); + + + + using (FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read)) + { + theDir.Files.Add(new THFileInfo() + { + Name = Path.GetFileName(path), + ByteSize = (int)fs.Length, + FileIcon = fileIcon + }); + } + + + } catch { } + } } } |
