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
- Pen.cs
- DiscriminatorMap.cs
- SharedStatics.cs
- TextServicesDisplayAttributePropertyRanges.cs
- _FixedSizeReader.cs
- ValidationException.cs
- TreeNodeClickEventArgs.cs
- EventLogPermissionEntry.cs
- GraphicsState.cs
- MultipartIdentifier.cs
- NotifyIcon.cs
- DataPagerField.cs
- ResourcePermissionBase.cs
- UnknownBitmapDecoder.cs
- DataGridToolTip.cs
- ProcessModelInfo.cs
- DataGridTablesFactory.cs
- UpDownEvent.cs
- IisTraceListener.cs
- WebPartCatalogCloseVerb.cs
- PlainXmlSerializer.cs
- srgsitem.cs
- X509IssuerSerialKeyIdentifierClause.cs
- UnsafeNativeMethods.cs
- ReadOnlyState.cs
- DateTimePicker.cs
- DataGridRowHeader.cs
- CapabilitiesPattern.cs
- FlowDocumentPage.cs
- ConstructorNeedsTagAttribute.cs
- ReleaseInstanceMode.cs
- DocumentApplicationDocumentViewer.cs
- HelpInfo.cs
- TimeSpanValidatorAttribute.cs
- CollectionViewProxy.cs
- MemberBinding.cs
- AssemblyFilter.cs
- ListItemCollection.cs
- AttributeData.cs
- CodeDomExtensionMethods.cs
- ConfigurationLockCollection.cs
- VirtualPath.cs
- DateBoldEvent.cs
- DataGridColumnCollection.cs
- WebPartDesigner.cs
- ACL.cs
- PagesSection.cs
- CachedPathData.cs
- XmlConverter.cs
- StreamInfo.cs
- FrameworkEventSource.cs
- StringWriter.cs
- ProviderConnectionPointCollection.cs
- PrintDialogException.cs
- EncoderNLS.cs
- CustomServiceCredentials.cs
- PersistenceException.cs
- VectorAnimationBase.cs
- XmlWellformedWriter.cs
- ContourSegment.cs
- View.cs
- PropertyConverter.cs
- ListViewGroupItemCollection.cs
- ContextMenuAutomationPeer.cs
- ObjectDataSourceSelectingEventArgs.cs
- CommonGetThemePartSize.cs
- Rules.cs
- ProviderConnectionPoint.cs
- FormViewDeleteEventArgs.cs
- Geometry3D.cs
- MouseGesture.cs
- MailHeaderInfo.cs
- GC.cs
- DataGridViewLinkColumn.cs
- SqlRecordBuffer.cs
- Timer.cs
- MatrixAnimationUsingPath.cs
- SynchronizationContext.cs
- DocumentXPathNavigator.cs
- TextAutomationPeer.cs
- ComplexTypeEmitter.cs
- CollectionBase.cs
- EdmComplexPropertyAttribute.cs
- DesignerDataConnection.cs
- EdmPropertyAttribute.cs
- SqlGenericUtil.cs
- SafeMILHandle.cs
- SymbolPair.cs
- XsdDataContractImporter.cs
- FacetDescription.cs
- ReadOnlyDictionary.cs
- QuestionEventArgs.cs
- categoryentry.cs
- XmlChildNodes.cs
- PenLineJoinValidation.cs
- FactoryGenerator.cs
- ObjectDataSourceMethodEventArgs.cs
- XamlTemplateSerializer.cs
- SoapSchemaExporter.cs
- FacetChecker.cs