using System; using System.Collections.Generic; using System.Text; namespace Developpez.Dotnet.System.Providers { /// /// Fournisseur d'informations systèmes /// /// Infrastructure internal class SystemInterop { #region Fournisseur /* * Il serait bien que ça tourne aussi sur Mono, mais on ne peux pas * forcément avoir les mêmes informations de la même manière sur tous les * systèmes ... sépération ? */ /// /// Fournisseur actuel /// private static ISystemInteropProvider systemProvider; /// /// Fournisseur actuel /// public static ISystemInteropProvider Provider { get { return systemProvider; } } /// /// Initialise une nouvelle instance du fournisseur d'informations systèmes /// static SystemInterop() { switch (Environment.OSVersion.Platform) { case PlatformID.Win32Windows: case PlatformID.Win32NT: { systemProvider = new WindowsProvider(); break; } case PlatformID.Unix: { systemProvider = new UnixProvider(); break; } default: /* aie */ { systemProvider = new NullSystemProvider(); break; } } } #endregion } }