2017-05-24 16:42:48 -04:00
|
|
|
|
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
|
|
|
|
|
{
|
2017-07-13 10:46:24 -04:00
|
|
|
|
public static bool IsInOpenDialog = false;
|
|
|
|
|
public static bool IsInSaveDialog = false;
|
|
|
|
|
public static string OnlyViewExtension = "";
|
|
|
|
|
public static void ActivateOpenFileDialog(string ExtensionToView)
|
2017-05-24 16:42:48 -04:00
|
|
|
|
{
|
|
|
|
|
IsInOpenDialog = true;
|
|
|
|
|
IsInSaveDialog = false;
|
|
|
|
|
OnlyViewExtension = ExtensionToView;
|
|
|
|
|
}
|
|
|
|
|
|
2017-07-13 10:46:24 -04:00
|
|
|
|
public static void ActivateSaveFileDialog(string ExtensionToView)
|
2017-05-24 16:42:48 -04:00
|
|
|
|
{
|
|
|
|
|
IsInOpenDialog = false;
|
|
|
|
|
IsInSaveDialog = true;
|
|
|
|
|
OnlyViewExtension = ExtensionToView;
|
|
|
|
|
}
|
|
|
|
|
|
2017-07-13 10:46:24 -04:00
|
|
|
|
public static string ReadTextFile(string path)
|
2017-05-24 16:42:48 -04:00
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
return File.ReadAllText(path);
|
|
|
|
|
} catch {
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|