private async Task InternalManageAppLifeCycleAsync(string jsonParam) { Logger.Log("InternalManageAppLifeCycleAsync() invoked.", LoggingLevel.Verbose); await Helpers.EnsureErrorsLogged(_deviceManagementClient, PropertySectionName, async() => { StatusSection status = new StatusSection(StatusSection.StateType.Pending); await _deviceManagementClient.ReportStatusAsync(PropertySectionName, status); // Parse json parameters AppxLifeCycleDataContract.ManageAppLifeCycleParams parameters = AppxLifeCycleDataContract.ManageAppLifeCycleParams.FromJsonString(jsonParam); // Construct request Message.AppLifecycleInfo appLifeCycleInfo = new Message.AppLifecycleInfo(); appLifeCycleInfo.AppId = parameters.pkgFamilyName; appLifeCycleInfo.Start = parameters.action == AppxLifeCycleDataContract.JsonStart; var request = new Message.AppLifecycleRequest(appLifeCycleInfo); // Send the request await _systemConfiguratorProxy.SendCommandAsync(request); // Report to the device twin status.State = StatusSection.StateType.Completed; await _deviceManagementClient.ReportStatusAsync(PropertySectionName, status); }); }
internal async Task AppLifecycleAsync(Message.AppLifecycleInfo appInfo) { var request = new Message.AppLifecycleRequest(appInfo); await this._systemConfiguratorProxy.SendCommandAsync(request); }