mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
78 lines
1.3 KiB
C#
78 lines
1.3 KiB
C#
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
|
|
}
|
|
}
|