public async Task <WindowsUpdateStatus> ReportWindowsUpdateStatusAsync() { var request = new Message.GetWindowsUpdatesRequest(); Message.GetWindowsUpdatesResponse windowsUpdatesResponse = await this._systemConfiguratorProxy.SendCommandAsync(request) as Message.GetWindowsUpdatesResponse; WindowsUpdateStatus status; status.approved = windowsUpdatesResponse.configuration.approved; status.installable = windowsUpdatesResponse.configuration.installable; status.installed = windowsUpdatesResponse.configuration.installed; status.lastScanTime = windowsUpdatesResponse.configuration.lastScanTime; status.pendingReboot = windowsUpdatesResponse.configuration.pendingReboot; status.failed = windowsUpdatesResponse.configuration.failed; status.deferUpgrade = windowsUpdatesResponse.configuration.deferUpgrade; return(status); }
// IClientPropertyHandler public async Task <JObject> GetReportedPropertyAsync() { Logger.Log("WindowsUpdatesHandler.GetReportedPropertyAsync()", LoggingLevel.Verbose); var request = new Message.GetWindowsUpdatesRequest(); var response = await _systemConfiguratorProxy.SendCommandAsync(request) as Message.GetWindowsUpdatesResponse; WindowsUpdatesDataContract.ReportedProperties reportedProperties = new WindowsUpdatesDataContract.ReportedProperties(); reportedProperties.approved = response.configuration.approved; reportedProperties.deferUpgrade = response.configuration.deferUpgrade; reportedProperties.failed = response.configuration.failed; reportedProperties.installable = response.configuration.installable; reportedProperties.installed = response.configuration.installed; reportedProperties.lastScanTime = response.configuration.lastScanTime; reportedProperties.pendingReboot = response.configuration.pendingReboot; return(reportedProperties.ToJsonObject()); }
private async Task <Message.GetWindowsUpdatesResponse> GetWindowsUpdatesAsync() { var request = new Message.GetWindowsUpdatesRequest(); return(await this._systemConfiguratorProxy.SendCommandAsync(request) as Message.GetWindowsUpdatesResponse); }