Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / 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
- MessagePropertyDescription.cs
- DataSetUtil.cs
- UrlAuthFailedErrorFormatter.cs
- Group.cs
- EventArgs.cs
- CodeTypeDelegate.cs
- DataBoundControlHelper.cs
- XmlSchemaType.cs
- HttpModuleActionCollection.cs
- BlockingCollection.cs
- CssTextWriter.cs
- NonBatchDirectoryCompiler.cs
- DeploymentExceptionMapper.cs
- DataGridColumnHeadersPresenter.cs
- SecurityDescriptor.cs
- StringFunctions.cs
- ProxyWebPartManager.cs
- SelectionProcessor.cs
- ToolStripMenuItem.cs
- PeerNearMe.cs
- TabPanel.cs
- UpdatePanelTrigger.cs
- ParentQuery.cs
- PlacementWorkspace.cs
- DependencyPropertyKey.cs
- BStrWrapper.cs
- WindowsIdentity.cs
- DecimalStorage.cs
- CodePageEncoding.cs
- DescendentsWalker.cs
- dbdatarecord.cs
- DecryptRequest.cs
- DbProviderSpecificTypePropertyAttribute.cs
- ACL.cs
- DataBinder.cs
- BinaryUtilClasses.cs
- EntityDataSourceContainerNameConverter.cs
- InputBindingCollection.cs
- XmlAutoDetectWriter.cs
- DataGridViewCellContextMenuStripNeededEventArgs.cs
- SiteMap.cs
- ReadOnlyCollectionBase.cs
- UnsafeNativeMethodsCLR.cs
- ClientSession.cs
- _ListenerRequestStream.cs
- METAHEADER.cs
- StorageMappingFragment.cs
- RuntimeArgumentHandle.cs
- ClientRuntimeConfig.cs
- SaveFileDialog.cs
- DataListItem.cs
- MissingMemberException.cs
- ScriptReferenceEventArgs.cs
- StructuralCache.cs
- CodeDefaultValueExpression.cs
- ObjectStateEntryDbDataRecord.cs
- PeerNodeAddress.cs
- PropertyReferenceExtension.cs
- ChtmlTextBoxAdapter.cs
- InkCanvasSelectionAdorner.cs
- Image.cs
- Ray3DHitTestResult.cs
- MethodAccessException.cs
- UpdateProgress.cs
- Vector.cs
- CapabilitiesAssignment.cs
- WSUtilitySpecificationVersion.cs
- PropertyGridDesigner.cs
- StoryFragments.cs
- OleDragDropHandler.cs
- GorillaCodec.cs
- DrawingContextDrawingContextWalker.cs
- LocalBuilder.cs
- SqlPersonalizationProvider.cs
- CodeExpressionStatement.cs
- Codec.cs
- InfoCardTrace.cs
- OptionalMessageQuery.cs
- Matrix3D.cs
- QueryStringParameter.cs
- RowToParametersTransformer.cs
- DefaultAuthorizationContext.cs
- BinaryWriter.cs
- Point3DAnimation.cs
- SafeFileHandle.cs
- NetPeerTcpBindingCollectionElement.cs
- HttpException.cs
- FlowDecisionLabelFeature.cs
- BaseParser.cs
- ProfilePropertySettings.cs
- ModelFactory.cs
- AppSettingsReader.cs
- BamlStream.cs
- ToolStripContentPanelRenderEventArgs.cs
- Message.cs
- IndependentAnimationStorage.cs
- XsdDuration.cs
- DialogResultConverter.cs
- XmlDataCollection.cs
- TraceData.cs