Example #1
0
        public async Task <WindowsTelemetryLevel> GetLevelAsync()
        {
            var request  = new Message.GetWindowsTelemetryRequest();
            var response = await _systemConfiguratorProxy.SendCommandAsync(request) as Message.GetWindowsTelemetryResponse;

            WindowsTelemetryLevel level = WindowsTelemetryLevel.Enhanced;

            switch (response.data.level)
            {
            case WindowsTelemetryDataContract.JsonSecurity:
                level = WindowsTelemetryLevel.Security;
                break;

            case WindowsTelemetryDataContract.JsonBasic:
                level = WindowsTelemetryLevel.Basic;
                break;

            case WindowsTelemetryDataContract.JsonEnhanced:
                level = WindowsTelemetryLevel.Enhanced;
                break;

            case WindowsTelemetryDataContract.JsonFull:
                level = WindowsTelemetryLevel.Full;
                break;

            default:
                throw new Error(ErrorCodes.INVALID_WINDOWS_TELEMETRY_LEVEL, "Found: " + response.data.level);
            }

            return(level);
        }
Example #2
0
        // IClientPropertyHandler
        public async Task <JObject> GetReportedPropertyAsync()
        {
            var request  = new Message.GetWindowsTelemetryRequest();
            var response = await _systemConfiguratorProxy.SendCommandAsync(request) as Message.GetWindowsTelemetryResponse;

            WindowsTelemetryDataContract.ReportedProperties reportedProperties = new WindowsTelemetryDataContract.ReportedProperties();
            reportedProperties.level = response.data.level;
            return(reportedProperties.ToJsonObject());
        }