Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Speech / Src / Internal / GrammarBuilding / RuleRefElement.cs / 1 / RuleRefElement.cs
//------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------- using System.Collections.Generic; using System.Diagnostics; using System.Speech.Recognition; using System.Speech.Internal.SrgsParser; using System.Text; namespace System.Speech.Internal.GrammarBuilding { ////// /// [DebuggerDisplay ("{DebugSummary}")] internal sealed class RuleRefElement : GrammarBuilderBase { //******************************************************************* // // Constructors // //******************************************************************* #region Constructors ////// /// /// internal RuleRefElement (RuleElement rule) { _rule = rule; } ////// /// /// /// internal RuleRefElement (RuleElement rule, string semanticKey) { _rule = rule; _semanticKey = semanticKey; } #endregion //******************************************************************** // // Public Methods // //******************************************************************* #region Public Methods /// TODOC <_include file='doc\SpeechAudioFormatInfo.uex' path='docs/doc[@for="SpeechAudioFormatInfo.Equals"]/*' /> public override bool Equals (object obj) { RuleRefElement refObj = obj as RuleRefElement; if (refObj == null) { return false; } return _semanticKey == refObj._semanticKey && _rule.Equals (refObj._rule); } /// TODOC <_include file='doc\SpeechAudioFormatInfo.uex' path='docs/doc[@for="SpeechAudioFormatInfo.GetHashCode"]/*' /> public override int GetHashCode () { return base.GetHashCode (); } #endregion //******************************************************************** // // Internal Methods // //******************************************************************** #region Internal Methods ////// /// /// internal void Add (GrammarBuilderBase item) { _rule.Add (item); } ////// /// ///override internal GrammarBuilderBase Clone () { return new RuleRefElement (_rule, _semanticKey); } /// /// /// ////// internal void CloneItems (RuleRefElement builders) { _rule.CloneItems (builders._rule); } /// /// /// /// /// /// /// ///override internal IElement CreateElement (IElementFactory elementFactory, IElement parent, IRule rule, IdentifierCollection ruleIds) { // Create the new rule and add the reference to the item return elementFactory.CreateRuleRef (parent, new Uri ("#" + Rule.RuleName, UriKind.Relative), _semanticKey, null); } #endregion //******************************************************************* // // Internal Properties // //******************************************************************** #region Internal Properties internal RuleElement Rule { get { return _rule; } } override internal string DebugSummary { get { return "#" + Rule.Name + (_semanticKey != null ? ":" + _semanticKey : ""); } } #endregion //******************************************************************* // // Private Fields // //******************************************************************* #region Private Fields /// /// /// private readonly RuleElement _rule; private readonly string _semanticKey; #endregion } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------- using System.Collections.Generic; using System.Diagnostics; using System.Speech.Recognition; using System.Speech.Internal.SrgsParser; using System.Text; namespace System.Speech.Internal.GrammarBuilding { ////// /// [DebuggerDisplay ("{DebugSummary}")] internal sealed class RuleRefElement : GrammarBuilderBase { //******************************************************************* // // Constructors // //******************************************************************* #region Constructors ////// /// /// internal RuleRefElement (RuleElement rule) { _rule = rule; } ////// /// /// /// internal RuleRefElement (RuleElement rule, string semanticKey) { _rule = rule; _semanticKey = semanticKey; } #endregion //******************************************************************** // // Public Methods // //******************************************************************* #region Public Methods /// TODOC <_include file='doc\SpeechAudioFormatInfo.uex' path='docs/doc[@for="SpeechAudioFormatInfo.Equals"]/*' /> public override bool Equals (object obj) { RuleRefElement refObj = obj as RuleRefElement; if (refObj == null) { return false; } return _semanticKey == refObj._semanticKey && _rule.Equals (refObj._rule); } /// TODOC <_include file='doc\SpeechAudioFormatInfo.uex' path='docs/doc[@for="SpeechAudioFormatInfo.GetHashCode"]/*' /> public override int GetHashCode () { return base.GetHashCode (); } #endregion //******************************************************************** // // Internal Methods // //******************************************************************** #region Internal Methods ////// /// /// internal void Add (GrammarBuilderBase item) { _rule.Add (item); } ////// /// ///override internal GrammarBuilderBase Clone () { return new RuleRefElement (_rule, _semanticKey); } /// /// /// ////// internal void CloneItems (RuleRefElement builders) { _rule.CloneItems (builders._rule); } /// /// /// /// /// /// /// ///override internal IElement CreateElement (IElementFactory elementFactory, IElement parent, IRule rule, IdentifierCollection ruleIds) { // Create the new rule and add the reference to the item return elementFactory.CreateRuleRef (parent, new Uri ("#" + Rule.RuleName, UriKind.Relative), _semanticKey, null); } #endregion //******************************************************************* // // Internal Properties // //******************************************************************** #region Internal Properties internal RuleElement Rule { get { return _rule; } } override internal string DebugSummary { get { return "#" + Rule.Name + (_semanticKey != null ? ":" + _semanticKey : ""); } } #endregion //******************************************************************* // // Private Fields // //******************************************************************* #region Private Fields /// /// /// private readonly RuleElement _rule; private readonly string _semanticKey; #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
- SiteMapDataSourceView.cs
- MetaModel.cs
- GeometryDrawing.cs
- SiteMapNodeCollection.cs
- MenuCommand.cs
- XsdDuration.cs
- ListViewGroup.cs
- InkCanvasSelection.cs
- DateTimePicker.cs
- CachedTypeface.cs
- ConnectorDragDropGlyph.cs
- ByteArrayHelperWithString.cs
- RepeatEnumerable.cs
- EmptyQuery.cs
- HandleExceptionArgs.cs
- XmlCharacterData.cs
- InfoCardBaseException.cs
- RegexGroupCollection.cs
- ResourceExpressionBuilder.cs
- DoubleCollectionConverter.cs
- CustomServiceCredentials.cs
- MarginsConverter.cs
- TypeLibConverter.cs
- TableChangeProcessor.cs
- SamlAction.cs
- ToolStripCustomTypeDescriptor.cs
- TransactionManager.cs
- ProjectionNode.cs
- WsiProfilesElement.cs
- ThicknessAnimationUsingKeyFrames.cs
- MobileTextWriter.cs
- EntityDataSourceWrapper.cs
- Int32Converter.cs
- ReaderContextStackData.cs
- ContainerTracking.cs
- DrawTreeNodeEventArgs.cs
- EmbeddedObject.cs
- TaiwanLunisolarCalendar.cs
- RuntimeResourceSet.cs
- XmlQualifiedName.cs
- SelectorItemAutomationPeer.cs
- PathTooLongException.cs
- IconConverter.cs
- UnsafeNativeMethods.cs
- SafeLocalMemHandle.cs
- XmlAutoDetectWriter.cs
- ValueSerializerAttribute.cs
- DataSourceCacheDurationConverter.cs
- EastAsianLunisolarCalendar.cs
- ReferencedAssembly.cs
- ObjectIDGenerator.cs
- RoleService.cs
- ConstraintStruct.cs
- CodeIdentifier.cs
- XmlnsDictionary.cs
- StrokeCollection.cs
- DataStorage.cs
- Rijndael.cs
- NamespaceInfo.cs
- SecUtil.cs
- MethodBody.cs
- CacheOutputQuery.cs
- RowSpanVector.cs
- MasterPageBuildProvider.cs
- GcSettings.cs
- SafeThreadHandle.cs
- SessionStateUtil.cs
- TypeInitializationException.cs
- AsyncOperationManager.cs
- LocationReferenceEnvironment.cs
- TableLayoutStyleCollection.cs
- OutputCacheModule.cs
- DbConnectionInternal.cs
- SplitterEvent.cs
- WmlCalendarAdapter.cs
- HwndKeyboardInputProvider.cs
- BuildResult.cs
- SplayTreeNode.cs
- Timer.cs
- ScalarConstant.cs
- DataRow.cs
- SHA512CryptoServiceProvider.cs
- Size.cs
- ExtensionQuery.cs
- StructuredTypeEmitter.cs
- StorageInfo.cs
- SizeConverter.cs
- ToolboxItemWrapper.cs
- SQLGuid.cs
- SiteMapNodeItemEventArgs.cs
- PermissionAttributes.cs
- ExpressionBinding.cs
- CollectionConverter.cs
- Currency.cs
- DmlSqlGenerator.cs
- CompleteWizardStep.cs
- ExtensionSimplifierMarkupObject.cs
- BinaryObjectReader.cs
- GrammarBuilderDictation.cs
- StreamMarshaler.cs