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
- GeneralTransform3DGroup.cs
- ToolStripLocationCancelEventArgs.cs
- NativeMethods.cs
- StickyNoteAnnotations.cs
- WebServiceHandler.cs
- ClassHandlersStore.cs
- EventWaitHandleSecurity.cs
- TemplateNameScope.cs
- ImageFormatConverter.cs
- StylusPoint.cs
- Command.cs
- DataGridViewCellCancelEventArgs.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- CircleHotSpot.cs
- XmlNavigatorFilter.cs
- HttpHandlersSection.cs
- RefType.cs
- BitmapPalette.cs
- FontStyleConverter.cs
- ReliableOutputSessionChannel.cs
- DirectionalLight.cs
- MediaCommands.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- TextRunCache.cs
- BaseParagraph.cs
- RepeaterItem.cs
- LicFileLicenseProvider.cs
- RegexMatch.cs
- XPathDocumentBuilder.cs
- QueryOptionExpression.cs
- MarshalByValueComponent.cs
- RSAPKCS1SignatureDeformatter.cs
- StorageComplexTypeMapping.cs
- TableRowCollection.cs
- HttpCacheVaryByContentEncodings.cs
- ProfileProvider.cs
- DragCompletedEventArgs.cs
- ScrollBarRenderer.cs
- TextEditor.cs
- UndirectedGraph.cs
- BaseTemplateBuildProvider.cs
- DataGridViewCellCancelEventArgs.cs
- BoolLiteral.cs
- InProcStateClientManager.cs
- CompilerCollection.cs
- ProjectedSlot.cs
- DebugTraceHelper.cs
- RegexRunner.cs
- FormViewPageEventArgs.cs
- AccessControlEntry.cs
- Base64Encoder.cs
- Convert.cs
- SecurityHelper.cs
- NotFiniteNumberException.cs
- BamlBinaryReader.cs
- TreeNodeMouseHoverEvent.cs
- ItemAutomationPeer.cs
- CodeSubDirectoriesCollection.cs
- CurrencyManager.cs
- SkewTransform.cs
- InternalBase.cs
- QilXmlReader.cs
- UnsafePeerToPeerMethods.cs
- ManagedWndProcTracker.cs
- InstanceStore.cs
- BrowserDefinition.cs
- BindingManagerDataErrorEventArgs.cs
- TabControlAutomationPeer.cs
- PersonalizationAdministration.cs
- HtmlListAdapter.cs
- NamedElement.cs
- AlphaSortedEnumConverter.cs
- COSERVERINFO.cs
- TraceAsyncResult.cs
- login.cs
- XmlElementCollection.cs
- ConfigurationSectionCollection.cs
- PerfService.cs
- SuppressIldasmAttribute.cs
- ParameterToken.cs
- tabpagecollectioneditor.cs
- GenericUI.cs
- mediaclock.cs
- ClientRuntimeConfig.cs
- DateTimeOffsetStorage.cs
- ECDiffieHellman.cs
- TreeNodeBinding.cs
- ColorTranslator.cs
- ResourcePart.cs
- ServiceEndpointElementCollection.cs
- EventLogLink.cs
- Queue.cs
- TextParaClient.cs
- WebConfigurationHostFileChange.cs
- XmlReflectionMember.cs
- ToolStripDesignerAvailabilityAttribute.cs
- FixedPageProcessor.cs
- RenderCapability.cs
- ModifierKeysConverter.cs
- AccessDataSource.cs