Exemple #1
0
        /// <summary>
        /// Invoked to send the Individualization Request
        /// </summary>
        async Task <bool> ReactiveIndividualizationRequestAsync(PlayReadyIndividualizationServiceRequest individualizationRequest, MediaProtectionServiceCompletion completionNotifier)
        {
            bool bResult = false;

            Log("ProtectionManager PlayReady Individualization Service Request in progress...");
            try
            {
                await individualizationRequest.BeginServiceRequest();

                bResult = true;
            }
            catch (COMException comException) when(comException.HResult == MSPR_E_CONTENT_ENABLING_ACTION_REQUIRED)
            {
                individualizationRequest.NextServiceRequest();
            }
            catch (Exception)
            {
            }

            if (bResult == true)
            {
                Log("ProtectionManager PlayReady Individualization Service Request successful");
            }
            else
            {
                Log("ProtectionManager PlayReady Individualization Service Request failed");
            }
            if (completionNotifier != null)
            {
                completionNotifier.Complete(bResult);
            }
            return(bResult);
        }
        /// <summary>
        /// Invoked to send the Individualization Request
        /// </summary>
        async Task <bool> ReactiveIndivRequest(PlayReadyIndividualizationServiceRequest IndivRequest, MediaProtectionServiceCompletion CompletionNotifier)
        {
            bool      bResult   = false;
            Exception exception = null;

            log("ProtectionManager PlayReady Individualization Service Request in progress...");
            try
            {
                await IndivRequest.BeginServiceRequest();
            }
            catch (Exception ex)
            {
                exception = ex;
            }
            finally
            {
                if (exception == null)
                {
                    bResult = true;
                }
                else
                {
                    COMException comException = exception as COMException;
                    if (comException != null && comException.HResult == MSPR_E_CONTENT_ENABLING_ACTION_REQUIRED)
                    {
                        IndivRequest.NextServiceRequest();
                    }
                }
            }
            if (bResult == true)
            {
                log("ProtectionManager PlayReady Individualization Service Request successful");
            }
            else
            {
                log("ProtectionManager PlayReady Individualization Service Request failed");
            }
            if (CompletionNotifier != null)
            {
                CompletionNotifier.Complete(bResult);
            }
            return(bResult);
        }
        /// <summary>
        /// Invoked to send the Individualization Request 
        /// </summary>
        async Task<bool> ReactiveIndivRequest(PlayReadyIndividualizationServiceRequest IndivRequest, MediaProtectionServiceCompletion CompletionNotifier)
        {
            bool bResult = false;
            Exception exception = null;
            log("ProtectionManager PlayReady Individualization Service Request in progress...");
            try
            {
                await IndivRequest.BeginServiceRequest();
            }
            catch (Exception ex)
            {
                exception = ex;
            }
            finally
            {
                if (exception == null)
                {
                    bResult = true;
                }
                else
                {
                    COMException comException = exception as COMException;
                    if (comException != null && comException.HResult == MSPR_E_CONTENT_ENABLING_ACTION_REQUIRED)
                    {
                        IndivRequest.NextServiceRequest();
                    }
                }
            }
            if (bResult == true)
                log("ProtectionManager PlayReady Individualization Service Request successful");
            else
                log("ProtectionManager PlayReady Individualization Service Request failed");
            if (CompletionNotifier != null) CompletionNotifier.Complete(bResult);
            return bResult;

        }
        /// <summary>
        /// Invoked to send the Individualization Request 
        /// </summary>
        async Task<bool> ReactiveIndividualizationRequestAsync(PlayReadyIndividualizationServiceRequest individualizationRequest, MediaProtectionServiceCompletion completionNotifier)
        {
            bool bResult = false;
            Log("ProtectionManager PlayReady Individualization Service Request in progress...");
            try
            {
                await individualizationRequest.BeginServiceRequest();
                bResult = true;
            }
            catch (COMException comException) when (comException.HResult == MSPR_E_CONTENT_ENABLING_ACTION_REQUIRED)
            {
                individualizationRequest.NextServiceRequest();
            }
            catch (Exception)
            {
            }

            if (bResult == true)
                Log("ProtectionManager PlayReady Individualization Service Request successful");
            else
                Log("ProtectionManager PlayReady Individualization Service Request failed");
            if (completionNotifier != null) completionNotifier.Complete(bResult);
            return bResult;

        }