mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Temp dir should be global
This commit is contained in:
@@ -20,6 +20,24 @@ namespace SabreTools.Library.Data
|
||||
|
||||
#region Public accessors
|
||||
|
||||
/// <summary>
|
||||
/// Command line arguments passed in to the parent program
|
||||
/// </summary>
|
||||
public static string CommandLineArgs => string.Join(" ", Environment.GetCommandLineArgs());
|
||||
|
||||
/// <summary>
|
||||
/// Directory path for the current executable
|
||||
/// </summary>
|
||||
public static string ExeDir => Path.GetDirectoryName(ExeName);
|
||||
|
||||
/// <summary>
|
||||
/// File path for the current executable
|
||||
/// </summary>
|
||||
public static string ExeName => new Uri(Assembly.GetExecutingAssembly().GetName().CodeBase).LocalPath;
|
||||
|
||||
/// <summary>
|
||||
/// Logging object for writing to file and console
|
||||
/// </summary>
|
||||
public static Logger Logger
|
||||
{
|
||||
get
|
||||
@@ -32,18 +50,23 @@ namespace SabreTools.Library.Data
|
||||
set { _logger = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Maximum threads to use during parallel operations
|
||||
/// </summary>
|
||||
public static int MaxThreads { get; set; } = Environment.ProcessorCount;
|
||||
|
||||
/// <summary>
|
||||
/// ParallelOptions object for use in parallel operations
|
||||
/// </summary>
|
||||
public static ParallelOptions ParallelOptions => new ParallelOptions()
|
||||
{
|
||||
MaxDegreeOfParallelism = MaxThreads
|
||||
};
|
||||
|
||||
public static string ExeName => new Uri(Assembly.GetExecutingAssembly().GetName().CodeBase).LocalPath;
|
||||
|
||||
public static string ExeDir => Path.GetDirectoryName(ExeName);
|
||||
|
||||
public static string CommandLineArgs => string.Join(" ", Environment.GetCommandLineArgs());
|
||||
/// <summary>
|
||||
/// Temporary directory location
|
||||
/// </summary>
|
||||
public static string TempDir { get; set; } = Path.GetTempPath();
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user