예제 #1
0
        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()");
        }
예제 #2
0
        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()");
        }
예제 #4
0
        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()");
        }
예제 #5
0
        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()");
        }