Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Speech / Src / Internal / GrammarBuilding / SemanticKeyElement.cs / 1 / SemanticKeyElement.cs
//------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------- using System.Collections.Generic; using System.Speech.Recognition; using System.Speech.Internal.SrgsParser; using System.Text; namespace System.Speech.Internal.GrammarBuilding { ////// /// internal sealed class SemanticKeyElement : BuilderElements { //******************************************************************* // // Constructors // //******************************************************************* #region Constructors ////// /// /// internal SemanticKeyElement (string semanticKey) { _semanticKey = semanticKey; RuleElement rule = new RuleElement (semanticKey); _ruleRef = new RuleRefElement (rule, _semanticKey); Items.Add (rule); Items.Add (_ruleRef); } #endregion //******************************************************************** // // Public Methods // //******************************************************************* #region Public Methods /// TODOC <_include file='doc\SpeechAudioFormatInfo.uex' path='docs/doc[@for="SpeechAudioFormatInfo.Equals"]/*' /> public override bool Equals (object obj) { SemanticKeyElement refObj = obj as SemanticKeyElement; if (refObj == null) { return false; } if (!base.Equals (obj)) { return false; } // No need to check for the equality on _ruleRef. The children are in the Items, not the underlying rule return _semanticKey == refObj._semanticKey; } /// 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 ////// /// /// new internal void Add (string phrase) { _ruleRef.Add (new GrammarBuilderPhrase (phrase)); } ////// /// /// new internal void Add (GrammarBuilder builder) { foreach (GrammarBuilderBase item in builder.InternalBuilder.Items) { _ruleRef.Add (item); } } ////// /// ///internal override GrammarBuilderBase Clone () { SemanticKeyElement semanticKeyElement = new SemanticKeyElement (_semanticKey); semanticKeyElement._ruleRef.CloneItems (_ruleRef); return semanticKeyElement; } /// /// /// /// /// /// /// ///internal override IElement CreateElement (IElementFactory elementFactory, IElement parent, IRule rule, IdentifierCollection ruleIds) { // Create the rule associated with this key _ruleRef.Rule.CreateElement (elementFactory, parent, rule, ruleIds); // Create the ruleRef IElement ruleRef = _ruleRef.CreateElement (elementFactory, parent, rule, ruleIds); return ruleRef; } #endregion //******************************************************************* // // Internal Properties // //******************************************************************** #region Internal Properties override internal string DebugSummary { get { return _ruleRef.Rule.DebugSummary; } } #endregion //******************************************************************* // // Private Fields // //******************************************************************* #region Private Fields /// /// /// private readonly string _semanticKey; private readonly RuleRefElement _ruleRef; #endregion } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SqlCacheDependency.cs
- TypeRefElement.cs
- SpotLight.cs
- entitydatasourceentitysetnameconverter.cs
- WasEndpointConfigContainer.cs
- PartialClassGenerationTask.cs
- DataViewManagerListItemTypeDescriptor.cs
- XPathMultyIterator.cs
- RequestDescription.cs
- NetworkInformationException.cs
- AsymmetricKeyExchangeDeformatter.cs
- HandlerBase.cs
- CodeGen.cs
- BaseDataList.cs
- ConsoleKeyInfo.cs
- StatusBarDrawItemEvent.cs
- MetaModel.cs
- Brushes.cs
- _NestedSingleAsyncResult.cs
- ScriptingProfileServiceSection.cs
- OrderPreservingPipeliningSpoolingTask.cs
- ConstraintConverter.cs
- ConditionCollection.cs
- SmtpFailedRecipientException.cs
- DbDataReader.cs
- PenThread.cs
- FunctionQuery.cs
- NamespaceMapping.cs
- HtmlTextArea.cs
- HtmlElementEventArgs.cs
- DiscardableAttribute.cs
- _AutoWebProxyScriptHelper.cs
- XmlAggregates.cs
- XmlSchemaAttribute.cs
- PopupControlService.cs
- RowUpdatingEventArgs.cs
- AliasedSlot.cs
- QueryContinueDragEventArgs.cs
- DataGridCommandEventArgs.cs
- DeleteBookmarkScope.cs
- Attributes.cs
- GB18030Encoding.cs
- FormViewUpdateEventArgs.cs
- BatchWriter.cs
- DataPagerFieldCommandEventArgs.cs
- RemotingServices.cs
- SchemaNames.cs
- MenuDesigner.cs
- Error.cs
- CanonicalXml.cs
- WebPartCancelEventArgs.cs
- ComplexTypeEmitter.cs
- FrameworkElement.cs
- AttachedPropertyBrowsableAttribute.cs
- NamespaceExpr.cs
- Viewport3DAutomationPeer.cs
- UpDownBase.cs
- RemotingServices.cs
- TransactionFlowElement.cs
- CharUnicodeInfo.cs
- DataGridViewCellStyle.cs
- HttpResponseBase.cs
- SingleAnimationBase.cs
- EnlistmentTraceIdentifier.cs
- Int64Storage.cs
- DataSourceProvider.cs
- X509WindowsSecurityToken.cs
- FontNameEditor.cs
- FreezableOperations.cs
- TextServicesManager.cs
- FilteredReadOnlyMetadataCollection.cs
- BitStack.cs
- ClientConfigPaths.cs
- SqlCommandBuilder.cs
- KeyboardEventArgs.cs
- BaseAddressPrefixFilterElement.cs
- CompensationTokenData.cs
- CatalogPartChrome.cs
- ColorConverter.cs
- Dictionary.cs
- RegularExpressionValidator.cs
- Stack.cs
- CheckBoxAutomationPeer.cs
- WindowsContainer.cs
- HtmlEncodedRawTextWriter.cs
- BookmarkTable.cs
- WindowsClaimSet.cs
- Range.cs
- ValidationEventArgs.cs
- Atom10FeedFormatter.cs
- ClonableStack.cs
- PolicyException.cs
- CompoundFileReference.cs
- ZoneMembershipCondition.cs
- RectAnimationUsingKeyFrames.cs
- SqlDataSourceQueryConverter.cs
- BitmapEffectInputData.cs
- RootProfilePropertySettingsCollection.cs
- InvalidPipelineStoreException.cs
- Menu.cs