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 / 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
- ErrorStyle.cs
- SymmetricKey.cs
- PriorityBindingExpression.cs
- BaseTemplateBuildProvider.cs
- Asn1IntegerConverter.cs
- XmlNode.cs
- TextViewElement.cs
- MultipartContentParser.cs
- X509Utils.cs
- RepeaterItem.cs
- ElementUtil.cs
- ParentControlDesigner.cs
- DrawingContextWalker.cs
- FullTextLine.cs
- DeploymentSection.cs
- RenderDataDrawingContext.cs
- MLangCodePageEncoding.cs
- TextUtf8RawTextWriter.cs
- IdnElement.cs
- ActivationServices.cs
- MetafileHeader.cs
- BulletedList.cs
- AQNBuilder.cs
- ColumnPropertiesGroup.cs
- BitmapEffectGeneralTransform.cs
- WindowsContainer.cs
- PrintPageEvent.cs
- Property.cs
- ExpressionVisitor.cs
- XmlLinkedNode.cs
- GAC.cs
- VariableAction.cs
- Manipulation.cs
- Fonts.cs
- DebugView.cs
- FileDialogCustomPlacesCollection.cs
- DbCommandDefinition.cs
- FileLogRecordEnumerator.cs
- DataServiceProcessingPipeline.cs
- DomNameTable.cs
- DataTableCollection.cs
- XmlnsDictionary.cs
- EncoderParameters.cs
- CommentAction.cs
- PathNode.cs
- cache.cs
- BindingExpression.cs
- TextEvent.cs
- CodeAttributeDeclarationCollection.cs
- SelectorAutomationPeer.cs
- XPathEmptyIterator.cs
- SectionInformation.cs
- PassportIdentity.cs
- ToolboxItemLoader.cs
- ContainerVisual.cs
- HtmlControlPersistable.cs
- SqlAggregateChecker.cs
- FileDataSource.cs
- CommonDialog.cs
- ObjectDataSourceSelectingEventArgs.cs
- DnsPermission.cs
- XmlChoiceIdentifierAttribute.cs
- Assembly.cs
- dbdatarecord.cs
- CodeTryCatchFinallyStatement.cs
- ClientUtils.cs
- XmlSignificantWhitespace.cs
- TextParagraph.cs
- TraceUtils.cs
- _RequestCacheProtocol.cs
- QuadraticBezierSegment.cs
- ScrollData.cs
- Freezable.cs
- CroppedBitmap.cs
- XmlSequenceWriter.cs
- DiscoveryEndpointValidator.cs
- XmlCharCheckingReader.cs
- NativeMethods.cs
- Label.cs
- PerfCounters.cs
- ZipIOCentralDirectoryDigitalSignature.cs
- BaseDataBoundControlDesigner.cs
- QuaternionRotation3D.cs
- ValidationSummary.cs
- RadioButton.cs
- WebEvents.cs
- DetailsViewInsertedEventArgs.cs
- XmlSchemaSimpleTypeRestriction.cs
- SharedStatics.cs
- Select.cs
- HandlerBase.cs
- Int32Storage.cs
- EnumConverter.cs
- RuleInfoComparer.cs
- GregorianCalendar.cs
- XmlCDATASection.cs
- sqlstateclientmanager.cs
- PartialCachingControl.cs
- ConfigurationManagerInternalFactory.cs
- EntryIndex.cs