mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[SabreTools.Library] Update folder name
This commit is contained in:
77
SabreTools.Library/Data/Globals.cs
Normal file
77
SabreTools.Library/Data/Globals.cs
Normal file
@@ -0,0 +1,77 @@
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
#if MONO
|
||||
using System.IO;
|
||||
#else
|
||||
using Alphaleonis.Win32.Filesystem;
|
||||
#endif
|
||||
|
||||
namespace SabreTools.Helper.Data
|
||||
{
|
||||
public class Globals
|
||||
{
|
||||
#region Private implementations
|
||||
|
||||
private static Logger _logger = null;
|
||||
private static int _maxDegreeOfParallelism = 4;
|
||||
private static string _exeName = new Uri(Assembly.GetExecutingAssembly().GetName().CodeBase).LocalPath;
|
||||
private static string _exeDir = Path.GetDirectoryName(_exeName);
|
||||
private static string _args = string.Join(" ", Environment.GetCommandLineArgs());
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public accessors
|
||||
|
||||
public static Logger Logger
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_logger == null)
|
||||
{
|
||||
_logger = new Logger();
|
||||
}
|
||||
return _logger;
|
||||
}
|
||||
set { _logger = value; }
|
||||
}
|
||||
public static int MaxDegreeOfParallelism
|
||||
{
|
||||
set { _maxDegreeOfParallelism = value; }
|
||||
}
|
||||
public static ParallelOptions ParallelOptions
|
||||
{
|
||||
get
|
||||
{
|
||||
return new ParallelOptions()
|
||||
{
|
||||
MaxDegreeOfParallelism = _maxDegreeOfParallelism
|
||||
};
|
||||
}
|
||||
}
|
||||
public static string ExeName
|
||||
{
|
||||
get
|
||||
{
|
||||
return _exeName;
|
||||
}
|
||||
}
|
||||
public static string ExeDir
|
||||
{
|
||||
get
|
||||
{
|
||||
return _exeDir;
|
||||
}
|
||||
}
|
||||
public static string CommandLineArgs
|
||||
{
|
||||
get
|
||||
{
|
||||
return _args;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user