Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Speech / Src / Internal / GrammarBuilding / GrammarBuilderDictation.cs / 1 / GrammarBuilderDictation.cs
//------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------- #define CODE_ANALYSIS using System.Speech.Recognition; using System.Speech.Internal.SrgsParser; using System.Diagnostics; namespace System.Speech.Internal.GrammarBuilding { ////// /// internal sealed class GrammarBuilderDictation : GrammarBuilderBase { //******************************************************************* // // Constructors // //******************************************************************* #region Constructors ////// /// internal GrammarBuilderDictation () : this (null) { } ////// /// /// internal GrammarBuilderDictation (string category) { _category = category; } #endregion //******************************************************************** // // Public Methods // //******************************************************************* #region Public Methods /// TODOC <_include file='doc\SpeechAudioFormatInfo.uex' path='docs/doc[@for="SpeechAudioFormatInfo.Equals"]/*' /> public override bool Equals (object obj) { GrammarBuilderDictation refObj = obj as GrammarBuilderDictation; if (refObj == null) { return false; } return _category == refObj._category; } /// TODOC <_include file='doc\SpeechAudioFormatInfo.uex' path='docs/doc[@for="SpeechAudioFormatInfo.GetHashCode"]/*' /> public override int GetHashCode () { return _category == null ? 0 : _category.GetHashCode (); } #endregion //******************************************************************** // // Internal Methods // //******************************************************************** #region Internal Methods ////// /// ///internal override GrammarBuilderBase Clone () { return new GrammarBuilderDictation (_category); } /// /// /// /// /// /// /// ///internal override IElement CreateElement (IElementFactory elementFactory, IElement parent, IRule rule, IdentifierCollection ruleIds) { // Return the IRuleRef to the dictation grammar return CreateRuleRefToDictation (elementFactory, parent); } #endregion //******************************************************************* // // Internal Properties // //******************************************************************** #region Internal Properties override internal string DebugSummary { get { string category = _category != null ? ":" + _category : string.Empty; return "dictation" + category; } } #endregion //******************************************************************* // // Private Methods // //******************************************************************* #region Private Methods /// /// /// /// /// ///private IRuleRef CreateRuleRefToDictation (IElementFactory elementFactory, IElement parent) { Uri ruleUri; if (!string.IsNullOrEmpty (_category) && _category == "spelling") { ruleUri = new Uri ("grammar:dictation#spelling", UriKind.RelativeOrAbsolute); } else { ruleUri = new Uri ("grammar:dictation", UriKind.RelativeOrAbsolute); } return elementFactory.CreateRuleRef (parent, ruleUri, null, null); } #endregion //******************************************************************* // // Private Fields // //******************************************************************** #region Private Fields /// /// /// private readonly string _category; #endregion } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------- #define CODE_ANALYSIS using System.Speech.Recognition; using System.Speech.Internal.SrgsParser; using System.Diagnostics; namespace System.Speech.Internal.GrammarBuilding { ////// /// internal sealed class GrammarBuilderDictation : GrammarBuilderBase { //******************************************************************* // // Constructors // //******************************************************************* #region Constructors ////// /// internal GrammarBuilderDictation () : this (null) { } ////// /// /// internal GrammarBuilderDictation (string category) { _category = category; } #endregion //******************************************************************** // // Public Methods // //******************************************************************* #region Public Methods /// TODOC <_include file='doc\SpeechAudioFormatInfo.uex' path='docs/doc[@for="SpeechAudioFormatInfo.Equals"]/*' /> public override bool Equals (object obj) { GrammarBuilderDictation refObj = obj as GrammarBuilderDictation; if (refObj == null) { return false; } return _category == refObj._category; } /// TODOC <_include file='doc\SpeechAudioFormatInfo.uex' path='docs/doc[@for="SpeechAudioFormatInfo.GetHashCode"]/*' /> public override int GetHashCode () { return _category == null ? 0 : _category.GetHashCode (); } #endregion //******************************************************************** // // Internal Methods // //******************************************************************** #region Internal Methods ////// /// ///internal override GrammarBuilderBase Clone () { return new GrammarBuilderDictation (_category); } /// /// /// /// /// /// /// ///internal override IElement CreateElement (IElementFactory elementFactory, IElement parent, IRule rule, IdentifierCollection ruleIds) { // Return the IRuleRef to the dictation grammar return CreateRuleRefToDictation (elementFactory, parent); } #endregion //******************************************************************* // // Internal Properties // //******************************************************************** #region Internal Properties override internal string DebugSummary { get { string category = _category != null ? ":" + _category : string.Empty; return "dictation" + category; } } #endregion //******************************************************************* // // Private Methods // //******************************************************************* #region Private Methods /// /// /// /// /// ///private IRuleRef CreateRuleRefToDictation (IElementFactory elementFactory, IElement parent) { Uri ruleUri; if (!string.IsNullOrEmpty (_category) && _category == "spelling") { ruleUri = new Uri ("grammar:dictation#spelling", UriKind.RelativeOrAbsolute); } else { ruleUri = new Uri ("grammar:dictation", UriKind.RelativeOrAbsolute); } return elementFactory.CreateRuleRef (parent, ruleUri, null, null); } #endregion //******************************************************************* // // Private Fields // //******************************************************************** #region Private Fields /// /// /// private readonly string _category; #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
- SeverityFilter.cs
- StoreConnection.cs
- DecoderExceptionFallback.cs
- HtmlTable.cs
- ArrangedElement.cs
- CurrentChangingEventManager.cs
- TabItemAutomationPeer.cs
- XmlEncoding.cs
- VectorCollectionConverter.cs
- ConfigXmlComment.cs
- WindowsContainer.cs
- CorrelationTokenTypeConvertor.cs
- ProtocolException.cs
- SettingsAttributes.cs
- ProviderException.cs
- DataGridViewRowCollection.cs
- ClientOperation.cs
- BmpBitmapEncoder.cs
- PrincipalPermission.cs
- NumericUpDownAcceleration.cs
- Dictionary.cs
- DataGridViewLinkCell.cs
- SecurityUniqueId.cs
- ThemeDictionaryExtension.cs
- BinaryFormatterWriter.cs
- SiblingIterators.cs
- Timeline.cs
- SelectionProviderWrapper.cs
- WebPartZoneBase.cs
- ComplexType.cs
- Stack.cs
- XmlAttributes.cs
- TabItemWrapperAutomationPeer.cs
- SamlDelegatingWriter.cs
- SyndicationElementExtensionCollection.cs
- SimpleTypesSurrogate.cs
- remotingproxy.cs
- HwndSource.cs
- SmiEventSink_Default.cs
- DataGridViewComboBoxEditingControl.cs
- ChooseAction.cs
- NullableConverter.cs
- ValidatingPropertiesEventArgs.cs
- DocumentsTrace.cs
- PersonalizationProviderHelper.cs
- DataGridViewCellEventArgs.cs
- BmpBitmapDecoder.cs
- JoinTreeSlot.cs
- SqlReferenceCollection.cs
- WebBrowserProgressChangedEventHandler.cs
- WhiteSpaceTrimStringConverter.cs
- InputProcessorProfiles.cs
- BindingWorker.cs
- ResourceDictionary.cs
- TypeSystem.cs
- TypeReference.cs
- ButtonFlatAdapter.cs
- XmlSiteMapProvider.cs
- IntPtr.cs
- HttpValueCollection.cs
- MailHeaderInfo.cs
- CodeAccessSecurityEngine.cs
- FilterFactory.cs
- SimpleHandlerFactory.cs
- ShellProvider.cs
- RNGCryptoServiceProvider.cs
- AuthenticationConfig.cs
- XPathDocumentNavigator.cs
- SchemaReference.cs
- StylusSystemGestureEventArgs.cs
- DataBoundControlDesigner.cs
- FontSizeConverter.cs
- DataGridViewCellValueEventArgs.cs
- _HTTPDateParse.cs
- PathData.cs
- EmptyElement.cs
- WebControlsSection.cs
- ReachPrintTicketSerializer.cs
- UiaCoreApi.cs
- EntityProviderFactory.cs
- XmlDataLoader.cs
- DataGridViewCellStateChangedEventArgs.cs
- IdentityHolder.cs
- SqlConnectionFactory.cs
- DataGridViewCheckBoxColumn.cs
- Oci.cs
- TraceSwitch.cs
- XmlIncludeAttribute.cs
- TimersDescriptionAttribute.cs
- CacheVirtualItemsEvent.cs
- CharStorage.cs
- ObjectStateEntryDbDataRecord.cs
- CoreSwitches.cs
- EditorPartChrome.cs
- TextServicesProperty.cs
- AttachInfo.cs
- TargetException.cs
- DesignerInterfaces.cs
- TextSimpleMarkerProperties.cs
- PhonemeEventArgs.cs