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
- Switch.cs
- Bold.cs
- WarningException.cs
- FileVersion.cs
- XamlPathDataSerializer.cs
- XmlParser.cs
- Win32SafeHandles.cs
- Viewport2DVisual3D.cs
- BamlMapTable.cs
- ScriptResourceMapping.cs
- ApplicationException.cs
- Style.cs
- Nodes.cs
- TypeCodeDomSerializer.cs
- CultureTable.cs
- StorageFunctionMapping.cs
- Bold.cs
- CursorInteropHelper.cs
- ValueUnavailableException.cs
- CommandHelpers.cs
- BindingManagerDataErrorEventArgs.cs
- AuthenticationConfig.cs
- Parser.cs
- CodeDOMUtility.cs
- EventsTab.cs
- ClientFormsIdentity.cs
- Bold.cs
- ApplicationServiceHelper.cs
- XmlUrlResolver.cs
- SecurityChannelFactory.cs
- RequestCachingSection.cs
- InputReport.cs
- SQLDateTimeStorage.cs
- DeobfuscatingStream.cs
- FixedSOMSemanticBox.cs
- FindSimilarActivitiesVerb.cs
- Rotation3D.cs
- XmlValidatingReaderImpl.cs
- ListenerElementsCollection.cs
- GeometryHitTestParameters.cs
- CodeTypeConstructor.cs
- PartialCachingControl.cs
- SeparatorAutomationPeer.cs
- OrderedEnumerableRowCollection.cs
- DrawingVisualDrawingContext.cs
- XmlDocumentFragment.cs
- OpenFileDialog.cs
- PageContentAsyncResult.cs
- smtpconnection.cs
- Variable.cs
- ListViewGroupItemCollection.cs
- UIPropertyMetadata.cs
- MailMessageEventArgs.cs
- LocatorPartList.cs
- WebPartConnectionsEventArgs.cs
- SafeArchiveContext.cs
- CodeTypeDeclarationCollection.cs
- QueryStatement.cs
- DateTimeConverter.cs
- FormsAuthenticationCredentials.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs
- EventlogProvider.cs
- MetadataUtil.cs
- SpecularMaterial.cs
- ConfigurationManagerHelper.cs
- AnnotationResourceChangedEventArgs.cs
- ADMembershipProvider.cs
- GradientStopCollection.cs
- SqlBinder.cs
- TableTextElementCollectionInternal.cs
- ValueChangedEventManager.cs
- TypeReference.cs
- PerfCounterSection.cs
- VirtualDirectoryMappingCollection.cs
- HttpListenerPrefixCollection.cs
- ButtonStandardAdapter.cs
- XmlSchemaObjectCollection.cs
- ClientSettingsSection.cs
- TemplateControlCodeDomTreeGenerator.cs
- BlurEffect.cs
- ShowExpandedMultiValueConverter.cs
- EUCJPEncoding.cs
- ShaperBuffers.cs
- PageStatePersister.cs
- RowUpdatedEventArgs.cs
- ObjectSpanRewriter.cs
- UseLicense.cs
- ClassData.cs
- MouseButton.cs
- DataList.cs
- ToolStripScrollButton.cs
- coordinatorfactory.cs
- XamlWrapperReaders.cs
- DomainConstraint.cs
- DataObjectMethodAttribute.cs
- WebPartCatalogCloseVerb.cs
- XsltQilFactory.cs
- TextBoxBase.cs
- PriorityRange.cs
- httpstaticobjectscollection.cs