You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
AM2RPortHelper/GlennLib/ModsBase.cs

35 lines
975 B

namespace GlennLib;
public abstract class ModsBase
{
public delegate void OutputHandlerDelegate(string output);
// Create before accessing anything
static ModsBase()
{
Directory.CreateDirectory(TempDir);
Directory.CreateDirectory(UtilDir);
}
/// <summary>
/// A temporary directory
/// </summary>
protected static string TempDir => CreateAndReturnTempPath();
private static string CreateAndReturnTempPath()
{
string path = Path.GetTempPath() + "/GlennPortHelper/";
Directory.CreateDirectory(path);
return path;
}
/// <summary>
/// The current directory of the program.
/// </summary>
protected static readonly string CurrentDir = Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory);
/// <summary>
/// The "utils" folder that's shipped with the tool.
/// </summary>
protected static readonly string UtilDir = CurrentDir + "/utils";
}