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
- CompilationPass2Task.cs
- WebPartVerb.cs
- ObjectStorage.cs
- InputMethodStateTypeInfo.cs
- ScriptDescriptor.cs
- ByteStreamGeometryContext.cs
- BindableAttribute.cs
- CodeDelegateCreateExpression.cs
- Label.cs
- _CommandStream.cs
- LogFlushAsyncResult.cs
- DbMetaDataFactory.cs
- CodeTypeDeclaration.cs
- DataServices.cs
- WebBaseEventKeyComparer.cs
- PublisherMembershipCondition.cs
- ImportContext.cs
- SqlTriggerAttribute.cs
- HighContrastHelper.cs
- StrokeNodeOperations.cs
- AppDomain.cs
- CompressedStack.cs
- RequestSecurityTokenResponseCollection.cs
- DPTypeDescriptorContext.cs
- SecurityTokenAuthenticator.cs
- RequestCachingSection.cs
- Int16KeyFrameCollection.cs
- ConfigurationLocationCollection.cs
- XmlExceptionHelper.cs
- DirectionalLight.cs
- Maps.cs
- SimpleColumnProvider.cs
- InvalidEnumArgumentException.cs
- WebPartExportVerb.cs
- Location.cs
- DataGridViewAutoSizeModeEventArgs.cs
- CellTreeNode.cs
- ContextMenuStripGroupCollection.cs
- WrapPanel.cs
- EntityTransaction.cs
- _ShellExpression.cs
- WebSysDefaultValueAttribute.cs
- BamlLocalizationDictionary.cs
- ImageListImage.cs
- MediaTimeline.cs
- ISAPIRuntime.cs
- DataColumnPropertyDescriptor.cs
- FormsAuthenticationUserCollection.cs
- DataGridViewTopLeftHeaderCell.cs
- XmlCharCheckingReader.cs
- GridLength.cs
- UInt64.cs
- FormsAuthenticationConfiguration.cs
- TreeNodeStyleCollection.cs
- ArrayWithOffset.cs
- SubpageParagraph.cs
- dtdvalidator.cs
- GuidelineSet.cs
- MemoryPressure.cs
- WorkingDirectoryEditor.cs
- IncomingWebRequestContext.cs
- PeerEndPoint.cs
- TextServicesCompartmentEventSink.cs
- ProxyFragment.cs
- MediaContext.cs
- Imaging.cs
- TokenCreationException.cs
- PropertyPathWorker.cs
- SiteOfOriginContainer.cs
- IssuedTokenClientElement.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- DocumentSequenceHighlightLayer.cs
- QuadTree.cs
- TranslateTransform3D.cs
- SymmetricKey.cs
- KeyNotFoundException.cs
- DrawingVisual.cs
- GenerateHelper.cs
- ReachFixedPageSerializerAsync.cs
- PnrpPeerResolverBindingElement.cs
- OperationFormatUse.cs
- ProcessProtocolHandler.cs
- BuildProviderCollection.cs
- XmlSchemaImporter.cs
- WorkflowRuntimeServiceElement.cs
- PngBitmapEncoder.cs
- SQLMoneyStorage.cs
- ColumnTypeConverter.cs
- ImageConverter.cs
- altserialization.cs
- DbConnectionPool.cs
- DocumentViewerBaseAutomationPeer.cs
- ApplicationServiceHelper.cs
- PrinterUnitConvert.cs
- ExpressionReplacer.cs
- DataGridViewRowHeaderCell.cs
- HashCryptoHandle.cs
- CodeDomExtensionMethods.cs
- UnmanagedMemoryStream.cs
- ViewGenResults.cs