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
- GridViewDesigner.cs
- BindingListCollectionView.cs
- AlignmentYValidation.cs
- EqualityComparer.cs
- PreviewPageInfo.cs
- ResourceSetExpression.cs
- BitmapImage.cs
- ListParagraph.cs
- Size.cs
- Application.cs
- RenderingEventArgs.cs
- PageHandlerFactory.cs
- DeviceContexts.cs
- CompoundFileStreamReference.cs
- SqlVersion.cs
- DesigntimeLicenseContextSerializer.cs
- AxHost.cs
- HostingEnvironment.cs
- ReachDocumentReferenceSerializer.cs
- SqlCacheDependency.cs
- InfoCardRSAPKCS1SignatureDeformatter.cs
- formatstringdialog.cs
- ListViewItem.cs
- ObjectQueryState.cs
- BamlBinaryReader.cs
- RotateTransform3D.cs
- ExpressionBuilderCollection.cs
- TextWriter.cs
- SpellerError.cs
- StringArrayConverter.cs
- ByteStack.cs
- UnsafeNativeMethods.cs
- MetabaseReader.cs
- DesignerExtenders.cs
- DispatcherOperation.cs
- HwndHostAutomationPeer.cs
- HtmlWindow.cs
- XmlSchemaSimpleContentRestriction.cs
- InheritedPropertyChangedEventArgs.cs
- OracleColumn.cs
- UserInitiatedRoutedEventPermissionAttribute.cs
- LinqDataView.cs
- smtpconnection.cs
- FixedTextPointer.cs
- sqlpipe.cs
- XmlAttribute.cs
- Point4D.cs
- ReadOnlyDataSource.cs
- MemoryStream.cs
- UnsafeNativeMethods.cs
- DataServiceHost.cs
- RegexCharClass.cs
- LinqDataSourceView.cs
- TextServicesLoader.cs
- PersonalizationProviderHelper.cs
- RepeaterItemCollection.cs
- ComponentCollection.cs
- PerfCounters.cs
- BasePattern.cs
- UInt64Storage.cs
- SqlDataSourceEnumerator.cs
- TextLineResult.cs
- DuplicateWaitObjectException.cs
- CheckPair.cs
- ComplexTypeEmitter.cs
- TypeForwardedToAttribute.cs
- XmlSchemaSimpleContentExtension.cs
- QilLoop.cs
- HandleRef.cs
- PerformanceCounter.cs
- DataGridViewRowEventArgs.cs
- FixedTextContainer.cs
- HierarchicalDataSourceConverter.cs
- MenuItemCollectionEditor.cs
- CodeVariableDeclarationStatement.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- PictureBox.cs
- ActiveXHelper.cs
- MsmqOutputSessionChannel.cs
- DataObjectFieldAttribute.cs
- ObjectDataSourceEventArgs.cs
- TraceListeners.cs
- AttachedAnnotationChangedEventArgs.cs
- TypeForwardedFromAttribute.cs
- PageClientProxyGenerator.cs
- HeaderedItemsControl.cs
- StylusPointCollection.cs
- EntityConnection.cs
- StaticFileHandler.cs
- DurationConverter.cs
- DataGridViewDataConnection.cs
- DataGridViewCell.cs
- ArithmeticLiteral.cs
- LambdaValue.cs
- Stream.cs
- TextFindEngine.cs
- Matrix3D.cs
- FixedSOMSemanticBox.cs
- XPathScanner.cs
- TerminatingOperationBehavior.cs