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
- TrayIconDesigner.cs
- VectorConverter.cs
- MappableObjectManager.cs
- SqlClientPermission.cs
- MaterialGroup.cs
- BufferModesCollection.cs
- XmlMtomReader.cs
- StylusShape.cs
- UTF7Encoding.cs
- WindowProviderWrapper.cs
- DocumentViewer.cs
- FormViewInsertedEventArgs.cs
- WebPartManager.cs
- BaseCodePageEncoding.cs
- SqlUtil.cs
- Constants.cs
- BinaryFormatter.cs
- WebReferencesBuildProvider.cs
- mediaeventshelper.cs
- StylusPointProperty.cs
- grammarelement.cs
- HostSecurityManager.cs
- BitmapEffectGroup.cs
- ArrayHelper.cs
- ScrollBar.cs
- SimpleWebHandlerParser.cs
- Track.cs
- Authorization.cs
- WmlMobileTextWriter.cs
- DataGridCheckBoxColumn.cs
- NativeMethodsCLR.cs
- EllipseGeometry.cs
- QueryPageSettingsEventArgs.cs
- DiscoveryClientProtocol.cs
- WpfWebRequestHelper.cs
- XmlName.cs
- ToolBarDesigner.cs
- AnnotationComponentManager.cs
- URL.cs
- DataView.cs
- _DigestClient.cs
- OleDbConnection.cs
- PauseStoryboard.cs
- ConvertersCollection.cs
- AjaxFrameworkAssemblyAttribute.cs
- Speller.cs
- KnownBoxes.cs
- SafeArchiveContext.cs
- RectangleGeometry.cs
- DataSetViewSchema.cs
- WebContext.cs
- DesignerCategoryAttribute.cs
- LoginUtil.cs
- SystemKeyConverter.cs
- PropertyEntry.cs
- PathSegmentCollection.cs
- CheckBoxBaseAdapter.cs
- AppDomainShutdownMonitor.cs
- DataSourceViewSchemaConverter.cs
- ThumbAutomationPeer.cs
- Panel.cs
- PeekCompletedEventArgs.cs
- WebAdminConfigurationHelper.cs
- AssociationSet.cs
- UnsafeNativeMethods.cs
- OrderByBuilder.cs
- Hash.cs
- DictionaryEntry.cs
- IDataContractSurrogate.cs
- OdbcCommandBuilder.cs
- StringPropertyBuilder.cs
- PointLight.cs
- AsymmetricKeyExchangeFormatter.cs
- SafeNativeMethods.cs
- ScriptRef.cs
- KeyManager.cs
- StaticDataManager.cs
- EntityDataSourceWrapperPropertyDescriptor.cs
- HebrewCalendar.cs
- MonthCalendar.cs
- CompositeFontFamily.cs
- ConfigXmlCDataSection.cs
- ConstantSlot.cs
- ExceptionUtil.cs
- MembershipUser.cs
- MDIClient.cs
- EmissiveMaterial.cs
- RowsCopiedEventArgs.cs
- ChangePasswordDesigner.cs
- SystemIPv6InterfaceProperties.cs
- RegexNode.cs
- InternalPolicyElement.cs
- PrintDocument.cs
- ComAwareEventInfo.cs
- SqlDataSourceQueryEditorForm.cs
- TreeNodeCollection.cs
- COM2ExtendedTypeConverter.cs
- BindingSourceDesigner.cs
- XPathNode.cs
- TraceProvider.cs