Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Speech / Src / Internal / SapiAttributeParser.cs / 1 / SapiAttributeParser.cs
//------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------- using System; using System.Collections.Generic; using System.Globalization; using System.Speech.Internal.SapiInterop; #if !SPEECHSERVER using System.Speech.AudioFormat; #endif namespace System.Speech.Internal { internal static class SapiAttributeParser { //******************************************************************* // // Internal Methods // //******************************************************************* #region Internal Methods static internal CultureInfo GetCultureInfoFromLanguageString (string valueString) { string [] strings = valueString.Split (';'); string langStringTrim = strings [0].Trim (); if (!string.IsNullOrEmpty (langStringTrim)) { try { return new CultureInfo (Int32.Parse (langStringTrim, NumberStyles.HexNumber, CultureInfo.InvariantCulture), false); } catch (ArgumentException) { return null; // If we have an invalid language id ignore it. Otherwise enumerating recognizers or voices would fail. } } return null; } #if !SPEECHSERVER static internal ListGetAudioFormatsFromString(string valueString) { List formatList = new List (); string [] strings = valueString.Split (';'); for (int i = 0; i < strings.Length; i++) { string formatString = strings [i].Trim (); if (!string.IsNullOrEmpty (formatString)) { SpeechAudioFormatInfo formatInfo = AudioFormatConverter.ToSpeechAudioFormatInfo (formatString); if (formatInfo != null) // Skip cases where a Guid is used. { formatList.Add (formatInfo); } } } return formatList; } #endif #endregion } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------ // // Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------- using System; using System.Collections.Generic; using System.Globalization; using System.Speech.Internal.SapiInterop; #if !SPEECHSERVER using System.Speech.AudioFormat; #endif namespace System.Speech.Internal { internal static class SapiAttributeParser { //******************************************************************* // // Internal Methods // //******************************************************************* #region Internal Methods static internal CultureInfo GetCultureInfoFromLanguageString (string valueString) { string [] strings = valueString.Split (';'); string langStringTrim = strings [0].Trim (); if (!string.IsNullOrEmpty (langStringTrim)) { try { return new CultureInfo (Int32.Parse (langStringTrim, NumberStyles.HexNumber, CultureInfo.InvariantCulture), false); } catch (ArgumentException) { return null; // If we have an invalid language id ignore it. Otherwise enumerating recognizers or voices would fail. } } return null; } #if !SPEECHSERVER static internal ListGetAudioFormatsFromString(string valueString) { List formatList = new List (); string [] strings = valueString.Split (';'); for (int i = 0; i < strings.Length; i++) { string formatString = strings [i].Trim (); if (!string.IsNullOrEmpty (formatString)) { SpeechAudioFormatInfo formatInfo = AudioFormatConverter.ToSpeechAudioFormatInfo (formatString); if (formatInfo != null) // Skip cases where a Guid is used. { formatList.Add (formatInfo); } } } return formatList; } #endif #endregion } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- HtmlTable.cs
- ConstantSlot.cs
- StandardBindingElement.cs
- DataConnectionHelper.cs
- SapiRecoContext.cs
- DtrList.cs
- PreProcessor.cs
- InputElement.cs
- InputBinder.cs
- NameTable.cs
- PixelShader.cs
- Duration.cs
- ReadWriteObjectLock.cs
- InvocationExpression.cs
- StreamSecurityUpgradeAcceptorBase.cs
- TemplateColumn.cs
- RegularExpressionValidator.cs
- RewritingProcessor.cs
- LinearKeyFrames.cs
- CrossContextChannel.cs
- TextReturnReader.cs
- CacheHelper.cs
- WindowsFormsLinkLabel.cs
- AuthStoreRoleProvider.cs
- CancellationScope.cs
- ViewStateModeByIdAttribute.cs
- XmlSchemaComplexType.cs
- XmlSchemaParticle.cs
- _RequestLifetimeSetter.cs
- SolidColorBrush.cs
- SqlDataSourceFilteringEventArgs.cs
- DataGridRow.cs
- ScrollItemPattern.cs
- Int16Animation.cs
- TraceFilter.cs
- ResourceDefaultValueAttribute.cs
- HexParser.cs
- HttpRequestCacheValidator.cs
- TextTreeInsertElementUndoUnit.cs
- ping.cs
- WsdlInspector.cs
- CqlQuery.cs
- LinqDataSourceStatusEventArgs.cs
- _StreamFramer.cs
- DataFieldConverter.cs
- DbConnectionPoolGroupProviderInfo.cs
- CounterCreationData.cs
- Exceptions.cs
- DATA_BLOB.cs
- Int64KeyFrameCollection.cs
- RuntimeWrappedException.cs
- ObjectComplexPropertyMapping.cs
- XmlHierarchicalEnumerable.cs
- TextElement.cs
- MultipleViewProviderWrapper.cs
- SubtreeProcessor.cs
- CodeTypeMemberCollection.cs
- LayoutTableCell.cs
- ObjectDataSourceMethodEventArgs.cs
- RetrieveVirtualItemEventArgs.cs
- DeviceOverridableAttribute.cs
- TimelineCollection.cs
- BlurBitmapEffect.cs
- SqlProvider.cs
- BindingObserver.cs
- Walker.cs
- BuildProvider.cs
- ContentPlaceHolder.cs
- DataGridViewImageCell.cs
- StringUtil.cs
- StylusPoint.cs
- MetadataItemEmitter.cs
- DrawListViewItemEventArgs.cs
- DocumentCollection.cs
- LogWriteRestartAreaAsyncResult.cs
- SEHException.cs
- InternalCache.cs
- AssemblyCache.cs
- CollectionsUtil.cs
- PasswordDeriveBytes.cs
- EditorAttributeInfo.cs
- ScriptManager.cs
- TypeElement.cs
- SafeSecurityHandles.cs
- EmbeddedMailObjectCollectionEditor.cs
- MarkupCompilePass2.cs
- ItemCheckEvent.cs
- IncrementalCompileAnalyzer.cs
- HtmlElementErrorEventArgs.cs
- SQLGuid.cs
- XmlWriter.cs
- Block.cs
- MenuBase.cs
- DynamicMetaObjectBinder.cs
- AutomationElementIdentifiers.cs
- Model3D.cs
- ObjectStateEntry.cs
- PartialClassGenerationTaskInternal.cs
- Descriptor.cs
- IFormattable.cs