public MacOSPropertyProvider(IEnvironmentTools envTools) { CodeContract.RequiresArgumentNotNull <IEnvironmentTools>(envTools, "envTools"); environmentTools = envTools; displayInfo = new Lazy <MacFoundation.CoreGraphics.DisplayInformation>(() => InitializeDisplayInfo(), false); operatingSystemVersionInfo = new Lazy <OSVersionInfo>(() => InitializeOSVersionInfo(), false); rootDriveInfo = new Lazy <RootDriveInfo>(() => InitializeRootDriveInfo(), false); totalVolumesSize = new Lazy <long?>(() => InitializeTotalVolumeSize(), false); productNameInfo = new Lazy <string>(() => InitializeProductNameInfo(), false); }
public UserInformationProviderBase(IInternalSettings internalSettings, IEnvironmentTools envTools, ILegacyApi legacyApi, Guid?userId) { CodeContract.RequiresArgumentNotNull <IInternalSettings>(internalSettings, "internalSettings"); CodeContract.RequiresArgumentNotNull <IEnvironmentTools>(envTools, "envTools"); CodeContract.RequiresArgumentNotNull <ILegacyApi>(legacyApi, "legacyApi"); this.internalSettings = internalSettings; environmentTools = envTools; this.legacyApi = legacyApi; canCollectPrivateInformation = new Lazy <bool>(CalculateCanCollectPrivateInformation, LazyThreadSafetyMode.ExecutionAndPublication); isUserMicrosoftInternal = new Lazy <bool>(CalculateIsInternal, LazyThreadSafetyMode.ExecutionAndPublication); this.userId = new Lazy <Guid>(() => (!userId.HasValue) ? this.legacyApi.ReadSharedUserId() : userId.Value, LazyThreadSafetyMode.ExecutionAndPublication); }
public WindowsOSPropertyProvider(IEnvironmentTools envTools, IRegistryTools regTools) { CodeContract.RequiresArgumentNotNull <IEnvironmentTools>(envTools, "envTools"); CodeContract.RequiresArgumentNotNull <IRegistryTools>(regTools, "regTools"); environmentTools = envTools; registryTools = regTools; buildLabInfo = new Lazy <string>(() => InitializeBuildLabInfo(), false); displayInfo = new Lazy <DisplayInformation>(() => InitializeDisplayInfo(), false); operatingSystemVersionInfo = new Lazy <OSVersionInfo>(() => InitializeOSVersionInfo(), false); productNameInfo = new Lazy <string>(() => InitializeProductNameInfo(), false); rootDriveInfo = new Lazy <RootDriveInfo>(() => InitializeRootDriveInfo(), false); totalVolumesSize = new Lazy <long?>(() => InitializeTotalVolumeSize(), false); clrInstalledVersion = new Lazy <int>(() => InitializeClrInstalledVersion(), false); clrRunningVersion = new Lazy <string>(() => InitializeClrRunningVersion(), false); }
public MonoUserInformationProvider(IInternalSettings internalSettings, IEnvironmentTools envTools, ILegacyApi legacyApi, Guid?userId) : base(internalSettings, envTools, legacyApi, userId) { }
private static IEnumerable <IPropertyProvider> GetPropertyProviders(IRegistryTools registryTools, IEnvironmentTools environmentTools, IHostInformationProvider host, IMachineInformationProvider machine, IMACInformationProvider macAddress, IUserInformationProvider user, IPersistentPropertyBag sharedProperties, IIdentityInformationProvider identity) { yield return(new IdentityPropertyProvider()); if (Platform.IsMac) { yield return(new MacHostPropertyProvider(host, new NsBundleInformationProvider())); yield return(new AssemblyPropertyProvider()); yield return(new MacLocalePropertyProvider()); yield return(new MacMachinePropertyProvider(machine, registryTools, macAddress)); yield return(new MacOSPropertyProvider(environmentTools)); yield return(new MacUserPropertyProvider(user)); yield return(new PersistentSharedPropertyProvider(sharedProperties)); } else if (Platform.IsLinux) { yield return(new LinuxHostPropertyProvider(host)); yield return(new AssemblyPropertyProvider()); yield return(new LinuxLocalePropertyProvider()); yield return(new PersistentSharedPropertyProvider(sharedProperties)); } else { yield return(new WindowsHostPropertyProvider(host)); yield return(new AssemblyPropertyProvider()); yield return(new WindowsLocalePropertyProvider(registryTools)); yield return(new WindowsMachinePropertyProvider(machine, registryTools, macAddress)); yield return(new WindowsOSPropertyProvider(environmentTools, registryTools)); yield return(new WindowsUserPropertyProvider(user)); yield return(new PersistentSharedPropertyProvider(sharedProperties)); } }
private static IUserInformationProvider GetUserInformationProvider(IRegistryTools registryTools, IInternalSettings internalSettings, IEnvironmentTools environmentTools, ILegacyApi legacyApi, TelemetrySessionSettings telemetrySessionSettings) { if (Platform.IsWindows) { return(new WindowsUserInformationProvider(registryTools, internalSettings, environmentTools, legacyApi, telemetrySessionSettings?.UserId)); } return(new MonoUserInformationProvider(internalSettings, environmentTools, legacyApi, telemetrySessionSettings?.UserId)); }
public WindowsUserInformationProvider(IRegistryTools regTools, IInternalSettings internalSettings, IEnvironmentTools envTools, ILegacyApi legacyApi, Guid?userId) : base(internalSettings, envTools, legacyApi, userId) { CodeContract.RequiresArgumentNotNull <IRegistryTools>(regTools, "regTools"); registryTools = regTools; userType = new Lazy <UserType>(() => CalculateUserType(), LazyThreadSafetyMode.ExecutionAndPublication); }