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
- Assert.cs
- XmlBinaryReader.cs
- ObjectViewEntityCollectionData.cs
- Preprocessor.cs
- TripleDESCryptoServiceProvider.cs
- BuildManagerHost.cs
- PartBasedPackageProperties.cs
- DependencyPropertyConverter.cs
- FtpWebResponse.cs
- ConfigurationSection.cs
- ChtmlMobileTextWriter.cs
- RegexCode.cs
- Geometry.cs
- TableProvider.cs
- SessionParameter.cs
- ReadOnlyDictionary.cs
- XamlReaderHelper.cs
- FormViewModeEventArgs.cs
- _Semaphore.cs
- Rule.cs
- ConfigXmlText.cs
- XpsFilter.cs
- WebPartUserCapability.cs
- QueryResults.cs
- WorkflowOperationContext.cs
- DoubleConverter.cs
- WebBrowserSiteBase.cs
- GACIdentityPermission.cs
- ArraySortHelper.cs
- PageTheme.cs
- AuthenticationException.cs
- SrgsGrammar.cs
- DragDrop.cs
- SqlXmlStorage.cs
- Floater.cs
- Aggregates.cs
- XamlInterfaces.cs
- PeerObject.cs
- UIElement3D.cs
- streamingZipPartStream.cs
- ApplicationInterop.cs
- OptimisticConcurrencyException.cs
- XmlSchemaObjectCollection.cs
- UpdateEventArgs.cs
- BuildProvider.cs
- Adorner.cs
- ResourcesBuildProvider.cs
- ImageMetadata.cs
- IdentityModelStringsVersion1.cs
- ClientRolePrincipal.cs
- XmlSecureResolver.cs
- AxisAngleRotation3D.cs
- Message.cs
- DataGridItemCollection.cs
- XmlSchemas.cs
- WpfSharedXamlSchemaContext.cs
- IsolatedStorageFilePermission.cs
- BindingMemberInfo.cs
- RuntimeHelpers.cs
- VideoDrawing.cs
- HyperLinkDesigner.cs
- EntityFrameworkVersions.cs
- Int16AnimationUsingKeyFrames.cs
- TypeValidationEventArgs.cs
- HttpAsyncResult.cs
- TextRunProperties.cs
- SourceFileBuildProvider.cs
- EnvelopedSignatureTransform.cs
- TypeLoadException.cs
- UniqueIdentifierService.cs
- XmlLinkedNode.cs
- MenuStrip.cs
- WorkflowShape.cs
- WithStatement.cs
- VScrollBar.cs
- TextRangeBase.cs
- TypeSemantics.cs
- BezierSegment.cs
- EventDescriptor.cs
- _ProxyRegBlob.cs
- SectionInput.cs
- PageRanges.cs
- LeaseManager.cs
- StringValidatorAttribute.cs
- LabelDesigner.cs
- TrackPoint.cs
- AnimationStorage.cs
- MemberPath.cs
- GridViewUpdatedEventArgs.cs
- TextCollapsingProperties.cs
- Ray3DHitTestResult.cs
- ToolStripItemRenderEventArgs.cs
- PrtCap_Public.cs
- NetworkInterface.cs
- HideDisabledControlAdapter.cs
- Thread.cs
- MouseWheelEventArgs.cs
- WebResponse.cs
- ReadingWritingEntityEventArgs.cs
- TextFormatterImp.cs