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 / 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
- DescendantBaseQuery.cs
- CompressionTransform.cs
- ProfileSection.cs
- SamlAuthorizationDecisionStatement.cs
- StrokeCollectionConverter.cs
- Model3DCollection.cs
- SchemaMapping.cs
- XmlDataSourceView.cs
- ComEventsInfo.cs
- AttributeData.cs
- TrackingRecord.cs
- IdentityHolder.cs
- SynchronizationContext.cs
- IListConverters.cs
- QuerySettings.cs
- SamlEvidence.cs
- VirtualDirectoryMapping.cs
- FilePresentation.cs
- ObjectToModelValueConverter.cs
- DataTemplateSelector.cs
- SchemaAttDef.cs
- ComponentDispatcher.cs
- HealthMonitoringSection.cs
- Container.cs
- OleDbErrorCollection.cs
- DBNull.cs
- CatalogPartCollection.cs
- ToggleButtonAutomationPeer.cs
- XmlnsPrefixAttribute.cs
- SerializationEventsCache.cs
- DecimalStorage.cs
- CellParagraph.cs
- XmlSchemaSimpleContentExtension.cs
- RoutedUICommand.cs
- KeyValuePair.cs
- ModifierKeysConverter.cs
- CatalogPart.cs
- PropertyDescriptorGridEntry.cs
- RouteTable.cs
- WebResponse.cs
- ConstraintStruct.cs
- DecimalAnimationBase.cs
- EdgeModeValidation.cs
- SerializationSectionGroup.cs
- AccessDataSource.cs
- StateMachineExecutionState.cs
- CanExecuteRoutedEventArgs.cs
- XmlSerializationGeneratedCode.cs
- BulletedList.cs
- Section.cs
- TrustManagerMoreInformation.cs
- DecoderExceptionFallback.cs
- ImplicitInputBrush.cs
- TransformProviderWrapper.cs
- EditorZoneBase.cs
- SqlClientFactory.cs
- OptionUsage.cs
- CssClassPropertyAttribute.cs
- webeventbuffer.cs
- CacheDependency.cs
- HashStream.cs
- MailAddressCollection.cs
- SqlFactory.cs
- GeneralTransform2DTo3D.cs
- HttpApplication.cs
- EditorZoneBase.cs
- RegexStringValidatorAttribute.cs
- CachingHintValidation.cs
- ColorTransformHelper.cs
- DataGridColumnHeadersPresenterAutomationPeer.cs
- SelectionList.cs
- CompositeKey.cs
- XamlSerializerUtil.cs
- TemplateLookupAction.cs
- SystemResources.cs
- RectangleHotSpot.cs
- MLangCodePageEncoding.cs
- ToolStripProgressBar.cs
- SmiEventSink_DeferedProcessing.cs
- MouseCaptureWithinProperty.cs
- RubberbandSelector.cs
- ReliableMessagingHelpers.cs
- Unit.cs
- AggregatePushdown.cs
- BaseDataList.cs
- ConnectionAcceptor.cs
- ToolStripContainer.cs
- View.cs
- Int32AnimationBase.cs
- AsymmetricCryptoHandle.cs
- IisTraceListener.cs
- MaxSessionCountExceededException.cs
- XmlSchemaAll.cs
- StorageBasedPackageProperties.cs
- UpdateProgress.cs
- ModelItemKeyValuePair.cs
- AddInProcess.cs
- ServiceModelEnumValidator.cs
- ToolStripDropDownClosingEventArgs.cs
- FontNamesConverter.cs