// Token: 0x06001D3A RID: 7482 RVA: 0x0007478C File Offset: 0x0007298C private static string CombineGALandPersonalContactXMLResults(string galResults, string personalContactsResults, MobileSpeechRecoResultType resultType) { string text = SpeechRecognitionUtils.ExtractResultsFromXML(galResults, resultType); string text2 = SpeechRecognitionUtils.ExtractResultsFromXML(personalContactsResults, resultType); return(string.Format("<?xml version=\"1.0\" encoding=\"utf-8\"?><MobileReco ResultType=\"{4}\"><{0}>{1}</{0}><{2}>{3}</{2}></MobileReco>", new object[] { "GALSearch", text, "PersonalContactSearch", text2, resultType.ToString() })); }
// Token: 0x06001D3B RID: 7483 RVA: 0x000747E4 File Offset: 0x000729E4 private static string ExtractResultsFromXML(string results, MobileSpeechRecoResultType resultType) { string result = string.Format("<MobileReco {0}=\"{1}\"/>", "ResultType", resultType.ToString()); if (!string.IsNullOrEmpty(results)) { using (XmlReader xmlReader = XmlReader.Create(new StringReader(results))) { if (xmlReader.IsStartElement("MobileReco")) { result = xmlReader.ReadOuterXml(); } } } return(result); }
public void ProcessAndFormatSpeechRecognitionResults(string result, out string jsonResponse, out SpeechRecognitionProcessor.SpeechHttpStatus httpStatus) { ExTraceGlobals.SpeechRecognitionTracer.TraceDebug <string>((long)this.GetHashCode(), "Entering CombinedScenariosRecognitionResultHandler.ProcessAndFormatSpeechRecognitionResults with results '{0}'", result); jsonResponse = null; httpStatus = SpeechRecognitionProcessor.SpeechHttpStatus.Success; MobileSpeechRecoResultType mobileSpeechRecoResultType = SpeechRecognitionUtils.ParseMobileScenarioXML(result); IMobileSpeechRecognitionResultHandler mobileSpeechRecognitionResultHandler = null; switch (mobileSpeechRecoResultType) { case MobileSpeechRecoResultType.DaySearch: mobileSpeechRecognitionResultHandler = new DaySearchRecognitionResultHandler(this.parameters.TimeZone); break; case MobileSpeechRecoResultType.AppointmentCreation: mobileSpeechRecognitionResultHandler = new DateTimeandDurationRecognitionResultHandler(this.parameters.TimeZone); break; case MobileSpeechRecoResultType.FindPeople: mobileSpeechRecognitionResultHandler = new FindPeopleSpeechRecognitionResultHandler(this.parameters, this.userContext, this.httpContext); break; case MobileSpeechRecoResultType.EmailPeople: mobileSpeechRecognitionResultHandler = new EmailPeopleSpeechRecognitionResultHandler(this.parameters, this.userContext, this.httpContext); break; case MobileSpeechRecoResultType.None: mobileSpeechRecognitionResultHandler = null; break; default: ExAssert.RetailAssert(false, "Invalid result type '{0}'", new object[] { mobileSpeechRecoResultType.ToString() }); break; } string text = string.Empty; CombinedScenarioRecoResult[] obj; if (mobileSpeechRecoResultType == MobileSpeechRecoResultType.None) { obj = new CombinedScenarioRecoResult[0]; } else { mobileSpeechRecognitionResultHandler.ProcessAndFormatSpeechRecognitionResults(result, out jsonResponse, out httpStatus); if (httpStatus != SpeechRecognitionProcessor.SpeechHttpStatus.Success) { return; } CombinedScenarioRecoResult combinedScenarioRecoResult = new CombinedScenarioRecoResult(); combinedScenarioRecoResult.RequestId = this.parameters.RequestId.ToString("N", CultureInfo.InvariantCulture); text = this.GetResultTextForLogging(result); combinedScenarioRecoResult.Text = text; combinedScenarioRecoResult.JsonResponse = jsonResponse; combinedScenarioRecoResult.ResultType = CombinedScenarioRecoResult.MapSpeechRecoResultTypeToCombinedRecoResultType(mobileSpeechRecoResultType); obj = new CombinedScenarioRecoResult[] { combinedScenarioRecoResult }; } jsonResponse = CombinedScenarioRecoResult.JsonSerialize(obj); this.CollectAndLogStatisticsInformation(mobileSpeechRecoResultType, text); ExTraceGlobals.SpeechRecognitionTracer.TraceDebug <string>((long)this.GetHashCode(), "Return json from CombinedScenarioResult: '{0}'", jsonResponse); }