mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
35 lines
982 B
C#
35 lines
982 B
C#
using System;
|
|
using System.Reflection;
|
|
#if NET452_OR_GREATER || NETCOREAPP
|
|
using System.Threading.Tasks;
|
|
#endif
|
|
|
|
namespace SabreTools.Core
|
|
{
|
|
/// <summary>
|
|
/// Globally-accessible objects for the library
|
|
/// </summary>
|
|
public class Globals
|
|
{
|
|
/// <summary>
|
|
/// The current toolset version to be used by all child applications
|
|
/// </summary>
|
|
public readonly static string? Version = Assembly.GetExecutingAssembly().GetName().Version?.ToString();
|
|
|
|
/// <summary>
|
|
/// Maximum threads to use during parallel operations
|
|
/// </summary>
|
|
public static int MaxThreads { get; set; } = Environment.ProcessorCount;
|
|
|
|
#if NET452_OR_GREATER || NETCOREAPP
|
|
/// <summary>
|
|
/// ParallelOptions object for use in parallel operations
|
|
/// </summary>
|
|
public static ParallelOptions ParallelOptions => new()
|
|
{
|
|
MaxDegreeOfParallelism = MaxThreads
|
|
};
|
|
#endif
|
|
}
|
|
}
|