protected MACInformationProvider(IProcessTools processTools, IPersistentPropertyBag persistentStorage, string command, string commandArgs) { CodeContract.RequiresArgumentNotNull <IProcessTools>(processTools, "processTools"); CodeContract.RequiresArgumentNotNull <IPersistentPropertyBag>(persistentStorage, "persistentStorage"); this.processTools = processTools; this.persistentStorage = persistentStorage; this.command = command; this.commandArgs = commandArgs; persistedMAC = new Lazy <string>(() => CalculateMACAddressHash(), LazyThreadSafetyMode.ExecutionAndPublication); }
private static IMACInformationProvider GetMACInformationProvider(IProcessTools processTools, IPersistentPropertyBag persistentStorage, ILegacyApi legacyApi) { if (Platform.IsWindows) { return(new WindowsMACInformationProvider(processTools, persistentStorage)); } if (Platform.IsMac) { return(new MacMACInformationProvider(persistentStorage, legacyApi)); } return(new MonoMACInformationProvider(processTools, persistentStorage)); }
public MonoMACInformationProvider(IProcessTools processTools, IPersistentPropertyBag persistentStorage) : base(processTools, persistentStorage, "ifconfig", "-a") { }
public WindowsMACInformationProvider(IProcessTools processTools, IPersistentPropertyBag persistentStorage) : base(processTools, persistentStorage, "getmac", null) { }