using System;
using System.Reflection;
#if NET452_OR_GREATER || NETCOREAPP
using System.Threading.Tasks;
#endif
namespace SabreTools.Core
{
///
/// Globally-accessible objects for the library
///
public class Globals
{
///
/// The current toolset version to be used by all child applications
///
public readonly static string? Version = Assembly.GetExecutingAssembly().GetName().Version?.ToString();
///
/// Maximum threads to use during parallel operations
///
public static int MaxThreads { get; set; } = Environment.ProcessorCount;
#if NET452_OR_GREATER || NETCOREAPP
///
/// ParallelOptions object for use in parallel operations
///
public static ParallelOptions ParallelOptions => new()
{
MaxDegreeOfParallelism = MaxThreads
};
#endif
}
}