Example #1
0
 // Token: 0x06001C74 RID: 7284 RVA: 0x00071C18 File Offset: 0x0006FE18
 private void HandleException(Exception e, int errorCode, SpeechRecognitionProcessor.SpeechProcessorAsyncCompletedDelegate callback)
 {
     ExTraceGlobals.SpeechRecognitionTracer.TraceError <Exception, int>((long)this.GetHashCode(), "LocalSpeechRecognition - Exception='{0}', Error Code='{1}'", e, errorCode);
     UmGlobals.ExEvent.LogEvent(UMEventLogConstants.Tuple_SpeechRecoRequestFailed, null, new object[]
     {
         base.RequestId,
         base.Parameters.UserObjectGuid,
         base.Parameters.TenantGuid,
         CommonUtil.ToEventLogString(e)
     });
     SpeechRecognitionProcessor.SpeechHttpStatus httpStatus = LocalSpeechRecognition.MapRpcErrorCodeToHttpErrorCode(errorCode);
     callback(new SpeechRecognitionProcessor.SpeechProcessorAsyncCompletedArgs(string.Empty, httpStatus));
 }
Example #2
0
        // Token: 0x06001C72 RID: 7282 RVA: 0x00071B3C File Offset: 0x0006FD3C
        private void OnRecognizeCompleted(IAsyncResult asyncResult)
        {
            ExTraceGlobals.SpeechRecognitionTracer.TraceDebug <Guid, string>((long)this.GetHashCode(), "LocalSpeechRecognition.OnRecognizeCompleted - RequestId='{0}' RequestType='{1}'", base.Parameters.RequestId, base.Parameters.RequestType.ToString());
            base.CollectAndLogStatisticsInformation(MobileSpeechRecoRequestStepLogId.RecognizeCompleted, -1);
            MobileSpeechRecoRpcClient mobileSpeechRecoRpcClient = (MobileSpeechRecoRpcClient)asyncResult.AsyncState;

            SpeechRecognitionProcessor.SpeechProcessorAsyncCompletedDelegate speechProcessorAsyncCompletedDelegate = mobileSpeechRecoRpcClient.State as SpeechRecognitionProcessor.SpeechProcessorAsyncCompletedDelegate;
            try
            {
                MobileRecoRPCAsyncCompletedArgs             mobileRecoRPCAsyncCompletedArgs = mobileSpeechRecoRpcClient.EndRecognize(asyncResult);
                SpeechRecognitionProcessor.SpeechHttpStatus httpStatus            = LocalSpeechRecognition.MapRpcErrorCodeToHttpErrorCode(mobileRecoRPCAsyncCompletedArgs.ErrorCode);
                SpeechRecognitionProcessor.SpeechProcessorAsyncCompletedArgs args = new SpeechRecognitionProcessor.SpeechProcessorAsyncCompletedArgs(mobileRecoRPCAsyncCompletedArgs.Result, httpStatus);
                speechProcessorAsyncCompletedDelegate(args);
            }
            catch (Exception e)
            {
                this.HandleUnexpectedException(e, speechProcessorAsyncCompletedDelegate);
            }
        }