using Developpez.Dotnet.System.Providers; namespace Developpez.Dotnet.System { /// /// Permet d'obtenir de manière précise la version installée /// du Framework .NET, et les informations concernant cette version /// /* en théorie, minimum = 2.0, maximum = 3.5 SP1 */ public static class FrameworkEnvironment { /* Ces informations sont dépendantes du système ... car sur mono ce n'est * pas la même manière de faire (sur Windows c'est le registre) */ #region Cache /// /// Initialise une instance du cache d'informations sur le Framework /// /// Infrastructure static FrameworkEnvironment() { LoadCache(); } /// /// Charge le cache /// /// Infrastructure private static void LoadCache() { fwVersion = SystemInterop.Provider.GetFrameworkVersion(); } /// /// Informations sur le Framework .NET /// /// Infrastructure private static FrameworkVersion fwVersion; #endregion /// /// Version (précise) du Framework .NET /// public static FrameworkVersion FrameworkVersion { get { return fwVersion; } } } }