public void DomainLeaveProactively() { TestLogger.LogMessage("Enter DomainLeave.DomainLeaveProactively()"); try { PlayReadyDomainLeaveServiceRequest domainLeaveRequest = new PlayReadyDomainLeaveServiceRequest(); DomainLeaveReactively(domainLeaveRequest); } catch (Exception ex) { if (ex.HResult == ServiceRequest.MSPR_E_NEEDS_INDIVIDUALIZATION) { PlayReadyIndividualizationServiceRequest indivServiceRequest = new PlayReadyIndividualizationServiceRequest(); RequestChain requestChain = new RequestChain(indivServiceRequest); requestChain.FinishAndReportResult(new ReportResultDelegate(HandleIndivServiceRequest_Finished)); } else { TestLogger.LogMessage("DomainLeaveProactively failed:" + ex.HResult); } } TestLogger.LogMessage("Leave DomainLeave.DomainLeaveProactively()"); }
protected virtual void DomainLeaveServiceRequestCompleted(PlayReadyDomainLeaveServiceRequest sender, Exception hrCompletionStatus) { TestLogger.LogImportantMessage("DomainLeaveServiceRequestCompleted"); if (hrCompletionStatus != null) { TestLogger.LogError("DomainLeaveServiceRequestCompleted failed with " + hrCompletionStatus.HResult); } }
void HandleDomainLeaveServiceRequest(PlayReadyDomainLeaveServiceRequest serviceRequest) { TestLogger.LogMessage(" "); TestLogger.LogMessage("Enter RequestChain.HandleDomainLeaveServiceRequest()"); _domainLeaveAndReportResult = new DomainLeaveAndReportResult(new ReportResultDelegate(HandleServiceRequest_Finished)); _domainLeaveAndReportResult.RequestConfigData = _requestConfigData; _domainLeaveAndReportResult.DomainLeaveReactively(serviceRequest); TestLogger.LogMessage("Leave RequestChain.HandleDomainLeaveServiceRequest()"); }
protected override void DomainLeaveServiceRequestCompleted(PlayReadyDomainLeaveServiceRequest sender, Exception hrCompletionStatus) { TestLogger.LogMessage("Enter DomainLeaveAndReportResult.DomainLeaveServiceRequestCompleted()"); if (hrCompletionStatus == null) { TestLogger.LogImportantMessage("***Domain Leave succeeded***"); _reportResult(true, null); } else { if (!PerformEnablingActionIfRequested(hrCompletionStatus)) { TestLogger.LogError("DomainLeaveServiceRequestCompleted ERROR: " + hrCompletionStatus.ToString()); _reportResult(false, null); } } TestLogger.LogMessage("Leave DomainLeaveAndReportResult.DomainLeaveServiceRequestCompleted()"); }
async public void DomainLeaveReactively(PlayReadyDomainLeaveServiceRequest domainLeaveRequest) { TestLogger.LogImportantMessage("Enter DomainLeave.DomainLeaveReactively()"); Exception exception = null; try { _serviceRequest = domainLeaveRequest; domainLeaveRequest.DomainServiceId = RequestConfigData.DomainServiceId; domainLeaveRequest.DomainAccountId = RequestConfigData.DomainAccountId; domainLeaveRequest.Uri = RequestConfigData.DomainUri; if (RequestConfigData.ManualEnabling) { TestLogger.LogMessage("Manually posting the request..."); HttpHelper httpHelper = new HttpHelper(domainLeaveRequest); await httpHelper.GenerateChallengeAndProcessResponse(); } else { TestLogger.LogImportantMessage("Begin domain leave service request..."); await domainLeaveRequest.BeginServiceRequest(); } } catch (Exception ex) { TestLogger.LogImportantMessage("Saving exception.."); exception = ex; } finally { DomainLeaveServiceRequestCompleted(domainLeaveRequest, exception); } TestLogger.LogImportantMessage("Leave DomainLeave.DomainLeaveReactively()"); }