Internal\SrgsCompiler\AppDomainGrammarProxy.cs (6)
47throw new InvalidOperationException(SR.Get(SRID.ArgumentMismatch));
122throw new FormatException(SR.Get(SRID.RecognizerRuleNotFoundStream, rule));
133throw new ArgumentException(SR.Get(SRID.RuleScriptInvalidParameters, _grammarType.FullName, rule), nameof(rule));
142throw new FormatException(SR.Get(SRID.RecognizerInvalidBinaryGrammar));
151throw new ArgumentException(SR.Get(SRID.RuleScriptInvalidParameters, ruleClass.FullName, rule), nameof(rule));
224throw new FormatException(SR.Get(SRID.CantFindAConstructor, grammar, rule, FormatConstructorParameters(mis, method)));
Internal\SrgsParser\XmlParser.cs (85)
74ThrowSrgsException(SRID.InvalidSrgsNamespace);
79ThrowSrgsException(SRID.GrammarDefTwice);
91ThrowSrgsException(SRID.InvalidSrgs);
97ThrowSrgsExceptionWithPosition(_filename, _reader, SR.Get(SRID.InvalidXmlFormat), eXml);
151XmlParser.ThrowSrgsException(SRID.InvalidQuotedString);
158XmlParser.ThrowSrgsException(SRID.InvalidQuotedString);
175XmlParser.ThrowSrgsException(SRID.InvalidTokenString);
188internal static void ThrowSrgsException(SRID id, params object?[]? args)
203string sLine = SR.Get(SRID.Line);
204string sPosition = SR.Get(SRID.Position);
291ThrowSrgsException(SRID.RootRuleAlreadyDefined);
299ThrowSrgsException(SRID.InvalidVersion);
326ThrowSrgsException(SRID.InvalidTagFormat);
343ThrowSrgsException(SRID.InvalidGrammarMode);
408ThrowSrgsException(SRID.UnsupportedPhoneticAlphabet, reader.Value);
421ThrowSrgsException(SRID.UnsupportedLanguage, reader.Value);
429ThrowSrgsException(SRID.NoName1, "namespace");
437ThrowSrgsException(SRID.NoName1, "codebehind");
457ThrowSrgsException(SRID.InvalidGrammarAttribute, reader.Name);
464ThrowSrgsException(SRID.MissingRequiredAttribute, "version", "grammar");
472ThrowSrgsException(SRID.MissingRequiredAttribute, "xml:lang", "grammar");
537ThrowSrgsException(SRID.InvalidRuleScope);
564ThrowSrgsException(SRID.InvalidDynamicSetting);
573ThrowSrgsException(SRID.NoName1, "baseclass");
603ThrowSrgsException(SRID.InvalidRuleAttribute, reader.Name);
609ThrowSrgsException(SRID.NoRuleId);
614XmlParser.ThrowSrgsException(SRID.OnInitOnPublicRule, "OnInit", id);
619XmlParser.ThrowSrgsException(SRID.OnInitOnPublicRule, "OnRecognition", id);
654ThrowSrgsException(SRID.InvalidEmptyRule, "rule", id);
688ThrowSrgsException(SRID.InvalidAttributeDefinedTwice, reader.Value, "special");
705ThrowSrgsException(SRID.InvalidSpecialRuleRef);
743ThrowSrgsException(SRID.InvalidRulerefAttribute, reader.Name);
755ThrowSrgsException(SRID.InvalidRuleRef, "uri");
764ThrowSrgsException(SRID.NoUriForSpecialRuleRef);
768ThrowSrgsException(SRID.NoAliasForSpecialRuleRef);
794ThrowSrgsException(SRID.InvalidOneOfAttribute, reader.Name);
845ThrowSrgsException(SRID.InvalidItemAttribute, reader.Name);
906ThrowSrgsException(SRID.InvalidSubsetAttribute, reader.Name);
914ThrowSrgsException(SRID.InvalidEmptyElement, "subset");
951XmlParser.ThrowSrgsException(SRID.EmptyPronunciationString);
956XmlParser.ThrowSrgsException(SRID.MuliplePronunciationString);
970XmlParser.ThrowSrgsException(SRID.EmptyDisplayString);
975XmlParser.ThrowSrgsException(SRID.MultipleDisplayString);
995ThrowSrgsException(SRID.InvalidReqConfAttribute, reader.Name);
1008ThrowSrgsException(SRID.InvalidTokenAttribute, reader.Name);
1017ThrowSrgsException(SRID.InvalidEmptyElement, "token");
1022ThrowSrgsException(SRID.InvalidTokenString);
1075ThrowSrgsException(SRID.MissingTagFormat);
1091ThrowSrgsException(SRID.InvalidTagAttribute, reader.Name);
1128ThrowSrgsException(SRID.InvalidLexiconAttribute, reader.Name);
1134ThrowSrgsException(SRID.MissingRequiredAttribute, "uri", "lexicon");
1159ThrowSrgsException(SRID.MetaNameHTTPEquiv);
1176ThrowSrgsException(SRID.InvalidMetaAttribute, reader.Name);
1182ThrowSrgsException(SRID.MissingRequiredAttribute, "content", "meta");
1186ThrowSrgsException(SRID.MissingRequiredAttribute, "name or http-equiv", "meta");
1200ThrowSrgsException(SRID.InvalidScriptAttribute);
1213ThrowSrgsException(SRID.RuleAttributeDefinedMultipleTimes);
1218ThrowSrgsException(SRID.InvalidScriptAttribute);
1244ThrowSrgsException(SRID.InvalidScriptAttribute);
1255ThrowSrgsException(SRID.InvalidAssemblyReferenceAttribute);
1270ThrowSrgsException(SRID.InvalidScriptAttribute);
1281ThrowSrgsException(SRID.InvalidImportNamespaceAttribute);
1309ThrowSrgsException(SRID.InvalidNotEmptyElement, parentName);
1322ThrowSrgsException(SRID.InvalidExampleOrdering);
1397ThrowSrgsException(SRID.InvalidNotEmptyElement, parentName);
1410ThrowSrgsException(SRID.InvalidElement, reader.Name);
1533ThrowSrgsException(SRID.InvalidGrammarOrdering);
1541ThrowSrgsException(SRID.InvalidGrammarOrdering);
1549ThrowSrgsException(SRID.InvalidGrammarOrdering);
1563ThrowSrgsException(SRID.InvalidGrammarOrdering);
1607ThrowSrgsException(SRID.InvalidElement, "text");
1615ThrowSrgsException(SRID.InvalidElement, reader.Name);
1659ThrowSrgsException(SRID.InvalidElement, reader.Name);
1706XmlParser.ThrowSrgsException(SRID.IncorrectAttributeValue, name, sTag.Substring(iEqual));
1746XmlParser.ThrowSrgsException(SRID.InvalidNameValueProperty, name, sValue);
1774XmlParser.ThrowSrgsException(SRID.MinMaxOutOfRange, minmax, minmax);
1792XmlParser.ThrowSrgsException(SRID.MinMaxOutOfRange, minRepeat, maxRepeat);
1798throw new ArgumentException(SR.Get(SRID.MinGreaterThanMax));
1803ThrowSrgsException(SRID.InvalidItemRepeatAttribute, repeat);
1808ThrowSrgsException(SRID.InvalidItemAttribute2);
1822XmlParser.ThrowSrgsException(SRID.InvalidAttributeDefinedTwice, reader.Value, attribute);
1834XmlParser.ThrowSrgsException(SRID.InvalidRuleId, id);
1847ThrowSrgsException(SRID.InvalidRuleRefSelf);
1859ThrowSrgsException(SRID.InvalidScriptDefinition, script._name);
1869XmlParser.ThrowSrgsException(SRID.RuleAttributeDefinedMultipleTimes, rule);
Internal\Synthesis\SSmlParser.cs (41)
51ThrowFormatException(SRID.GrammarDefTwice);
64ThrowFormatException(SRID.SynthesizerNoSpeak);
69throw new FormatException(SR.Get(SRID.InvalidXml), eXml);
107ThrowFormatException(SRID.InvalidVersion);
176ThrowFormatException(innerException, SRID.InvalidElement, reader.Name);
182ThrowFormatException(SRID.MissingRequiredAttribute, "version", "speak");
187ThrowFormatException(SRID.MissingRequiredAttribute, "lang", "speak");
252ThrowFormatException(SRID.InvalidElement, reader.Name);
270ThrowFormatException(SRID.InvalidElement, reader.Name);
340ThrowFormatException(SRID.InvalidItemAttribute, reader.Name);
416ThrowFormatException(SRID.InvalidSpeakAttribute, reader.Name, "break");
472ThrowFormatException(SRID.InvalidItemAttribute, reader.Name);
531ThrowFormatException(SRID.InvalidItemAttribute, reader.Name);
579ThrowFormatException(SRID.InvalidItemAttribute, reader.Name);
585ThrowFormatException(SRID.MissingRequiredAttribute, "name", "mark");
684ThrowFormatException(SRID.InvalidItemAttribute, reader.Name);
756throw new FormatException(SR.Get(SRID.UnsupportedAlphabet, sAlphabet));
771ThrowFormatException(SRID.InvalidItemAttribute, reader.Name);
777ThrowFormatException(SRID.MissingRequiredAttribute, "ph", "phoneme");
820ThrowFormatException(SRID.InvalidItemAttribute, "phoneme");
894ThrowFormatException(SRID.InvalidItemAttribute, reader.Name);
900ThrowFormatException(SRID.MissingRequiredAttribute, "pitch, contour, range, rate, duration, volume", "prosody");
963ThrowFormatException(SRID.InvalidItemAttribute, reader.Name);
969ThrowFormatException(SRID.MissingRequiredAttribute, "interpret-as", "say-as");
1023ThrowFormatException(SRID.InvalidItemAttribute, reader.Name);
1029ThrowFormatException(SRID.MissingRequiredAttribute, "alias", "sub");
1048ThrowFormatException(SRID.InvalidVoiceElementInPromptOutput);
1174ThrowFormatException(SRID.InvalidItemAttribute, reader.Name);
1189ThrowFormatException(SRID.MissingRequiredAttribute, "'xml:lang' or 'gender' or 'age' or 'variant' or 'name'", "voice");
1253ThrowFormatException(SRID.InvalidItemAttribute, reader.Name);
1259ThrowFormatException(SRID.MissingRequiredAttribute, "uri", "lexicon");
1304ThrowFormatException(SRID.InvalidItemAttribute, reader.Name);
1311ThrowFormatException(SRID.InvalidElement, reader.Name);
1339ThrowFormatException(SRID.InvalidItemAttribute, reader.Name);
1346ThrowFormatException(SRID.InvalidElement, reader.Name);
1420ThrowFormatException(SRID.InvalidItemAttribute, reader.Name);
1426ThrowFormatException(SRID.InvalidElement, reader.Name);
1483ThrowFormatException(SRID.InvalidAttributeDefinedTwice, reader.Value, attribute);
1774ThrowFormatException(SRID.InvalidElement, sElement);
1783private static void ThrowFormatException(SRID id, params object[] args)
1792private static void ThrowFormatException(Exception? innerException, SRID id, params object[] args)
Recognition\Grammar.cs (16)
51throw new ArgumentException(SR.Get(SRID.RecognizerGrammarNotFound), nameof(path), e);
107throw new ArgumentException(SR.Get(SRID.StreamMustBeReadable), nameof(stream));
149throw new ArgumentException(SR.Get(SRID.StrongTypedGrammarNotAGrammar), nameof(type));
181throw new ArgumentException(SR.Get(SRID.RuleScriptInvalidParameters, typeTarget.Name, typeTarget.Name));
221throw new ArgumentOutOfRangeException(nameof(value), SR.Get(SRID.GrammarInvalidWeight));
246throw new ArgumentOutOfRangeException(nameof(value), SR.Get(SRID.GrammarInvalidPriority));
496throw new ArgumentException(SR.Get(SRID.DictationInvalidTopic), nameof(uri));
743throw new ArgumentException(SR.Get(SRID.RuleScriptInvalidParameters, typeTarget.Name, typeTarget.Name));
802throw new FormatException(SR.Get(SRID.CantFindAConstructor, grammar, rule, FormatConstructorParameters(cis)));
919throw new FormatException(SR.Get(SRID.RecognizerInvalidBinaryGrammar));
926throw new ArgumentException(SR.Get(SRID.CannotLoadDotNetSemanticCode));
932throw new ArgumentException(SR.Get(SRID.CannotLoadDotNetSemanticCode), e);
1024throw new ArgumentException(SR.Get(SRID.RuleScriptInvalidParameters, _ruleName, _ruleName));
1032throw new ArgumentException(SR.Get(SRID.RuleScriptInvalidParameters, _ruleName, _ruleName));
1063throw new ArgumentException(SR.Get(SRID.SapiErrorNoRulesToActivate));
1083throw new ArgumentException(SR.Get(SRID.RecognizerRuleNotFoundStream, rulename));
Recognition\RecognizerBase.cs (57)
134throw new OperationCanceledException(SR.Get(SRID.OperationAborted));
223throw new NotSupportedException(SR.Get(SRID.NotSupportedWithThisVersionOfSAPI2, "Weight"));
253throw new NotSupportedException(SR.Get(SRID.NotSupportedWithThisVersionOfSAPI2, "Priority"));
267throw new NotSupportedException(SR.Get(SRID.CannotSetPriorityOnDictation));
338throw new NotSupportedException(SR.Get(SRID.NotSupportedWithThisVersionOfSAPICompareOption));
357throw new NotSupportedException(SR.Get(SRID.NotSupportedWithThisVersionOfSAPICompareOption));
372throw new NotSupportedException(SR.Get(SRID.NotSupportedWithThisVersionOfSAPI));
380throw new ArgumentException(SR.Get(SRID.ArrayOfNullIllegal), nameof(wordUnits));
396throw new NotSupportedException(SR.Get(SRID.NotSupportedWithThisVersionOfSAPI));
404throw new ArgumentException(SR.Get(SRID.ArrayOfNullIllegal), nameof(wordUnits));
427throw new NotSupportedException(SR.Get(SRID.NegativeTimesNotSupported));
431throw new NotSupportedException(SR.Get(SRID.NotSupportedWithThisVersionOfSAPI));
459throw new PlatformNotSupportedException(SR.Get(SRID.RecognitionNotSupported));
528throw new InvalidOperationException(SR.Get(SRID.RecognizerAlreadyRecognizing));
532throw new InvalidOperationException(SR.Get(SRID.RecognizerNoInputSource));
554throw new OperationCanceledException(SR.Get(SRID.OperationAborted));
750throw new InvalidOperationException(SR.Get(SRID.RecognizerAlreadyRecognizing));
786throw new InvalidOperationException(SR.Get(SRID.RecognizerAlreadyRecognizing));
874SRID srid = SapiConstants.SapiErrorCode2SRID(errorCode);
885return new NotSupportedException(SR.Get(SRID.RecognitionNotSupportedOn64bit));
889return new PlatformNotSupportedException(SR.Get(SRID.RecognitionNotSupported));
948throw new ArgumentOutOfRangeException(nameof(value), SR.Get(SRID.NegativeTimesNotSupported));
955throw new InvalidOperationException(SR.Get(SRID.RecognizerAlreadyRecognizing));
970throw new ArgumentOutOfRangeException(nameof(value), SR.Get(SRID.NegativeTimesNotSupported));
977throw new InvalidOperationException(SR.Get(SRID.RecognizerAlreadyRecognizing));
1202throw new ArgumentOutOfRangeException(nameof(value), SR.Get(SRID.MaxAlternatesInvalid));
1461throw new ArgumentException(SR.Get(SRID.DictationTopicNotFound, uri), e);
1517throw new FormatException(SR.Get(SRID.SapiErrorRuleNotFound2, ruleName, bstrResourceUri));
1609throw new FormatException(SR.Get(SRID.RecognizerInvalidBinaryGrammar), e);
1613throw new FormatException(SR.Get(SRID.SapiErrorInvalidImport), e);
1617throw new NotSupportedException(SR.Get(SRID.SapiErrorTooManyGrammars), e);
1621throw new FileNotFoundException(SR.Get(SRID.ReferencedGrammarNotFound), e);
1640throw new FormatException(SR.Get(SRID.RecognizerInvalidBinaryGrammar), e);
1667throw new NotSupportedException(SR.Get(SRID.CannotSetPriorityOnDictation));
1688throw new NotSupportedException(SR.Get(SRID.NotSupportedWithThisVersionOfSAPI));
1807throw new InvalidOperationException(SR.Get(SRID.SapiErrorTooManyGrammars));
1823throw new InvalidOperationException(SR.Get(SRID.GrammarWrongRecognizer));
1835throw new InvalidOperationException(SR.Get(SRID.GrammarNotLoaded));
1837throw new InvalidOperationException(SR.Get(SRID.GrammarLoadingInProgress));
1839throw new InvalidOperationException(SR.Get(SRID.GrammarLoadFailed));
1841throw new InvalidOperationException(SR.Get(SRID.GrammarAlreadyLoaded));
1883throw new InvalidOperationException(SR.Get(SRID.RecognizerAlreadyRecognizing));
1976throw new FormatException(SR.Get(SRID.RecognizerNoRootRuleToActivate));
1980throw new ArgumentException(SR.Get(SRID.RecognizerRuleNotFoundStream, ruleName), nameof(ruleName));
1987throw new FormatException(SR.Get(SRID.RecognizerNoRootRuleToActivate1, uri));
1991throw new ArgumentException(SR.Get(SRID.RecognizerRuleNotFound, ruleName, uri), nameof(ruleName));
2000throw new COMException(SR.Get(SRID.RecognizerRuleActivationFailed), (int)errorCode);
2621SRID srid = SapiConstants.SapiErrorCode2SRID(errorCode);
2631SRID srid = SapiConstants.SapiErrorCode2SRID(errorCode);
2638return new COMException(SR.Get(SRID.AudioDeviceInternalError), (int)errorCode);
2661throw new NotSupportedException(SR.Get(SRID.NotSupportedWithThisVersionOfSAPICompareOption));
2708throw new InvalidOperationException(SR.Get(SRID.RecognizerUpdateTableTooLarge));
2944SRID messageId = (SRID)(-1);
2947messageId = SRID.NotSupportedWithThisVersionOfSAPIBaseUri;
2951messageId = SRID.NotSupportedWithThisVersionOfSAPITagFormat;
2953if (messageId != (SRID)(-1))
Synthesis\PromptBuilder.cs (16)
29throw new ArgumentException(SR.Get(SRID.InvariantCultureInfo), nameof(culture));
257throw new InvalidOperationException(SR.Get(SRID.PromptBuilderMismatchStyle));
275throw new ArgumentException(SR.Get(SRID.EnumInvalid, "VoiceGender"), nameof(voice));
280throw new ArgumentException(SR.Get(SRID.EnumInvalid, "VoiceAge"), nameof(voice));
345throw new InvalidOperationException(SR.Get(SRID.PromptBuilderMismatchVoice));
369throw new ArgumentException(SR.Get(SRID.InvariantCultureInfo), nameof(culture));
384throw new InvalidOperationException(SR.Get(SRID.PromptBuilderMismatchParagraph));
405throw new ArgumentException(SR.Get(SRID.InvariantCultureInfo), nameof(culture));
421throw new InvalidOperationException(SR.Get(SRID.PromptBuilderMismatchSentence));
779string sMsg = SR.Get(SRID.PromptBuilderInvalideState);
783sMsg += SR.Get(SRID.PromptBuilderStateEnded);
787sMsg += SR.Get(SRID.PromptBuilderStateSentence);
791sMsg += SR.Get(SRID.PromptBuilderStateParagraph);
797sMsg += SR.Get(SRID.PromptBuilderStateStyle);
801sMsg += SR.Get(SRID.PromptBuilderStateVoice);
958throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, SR.Get(SRID.PromptBuilderInvalidElement), currentElement.ToString(), stackElement._state.ToString()));