Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Speech / Src / Internal / GrammarBuilding / RuleElement.cs / 1 / RuleElement.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 RuleElement : BuilderElements { //******************************************************************* // // Constructors // //******************************************************************* #region Constructors ////// /// /// internal RuleElement (string name) { _name = name; } ////// /// /// /// internal RuleElement (GrammarBuilderBase builder, string name) : this (name) { Add (builder); } #endregion //******************************************************************** // // Public Methods // //******************************************************************* #region Public Methods /// TODOC <_include file='doc\SpeechAudioFormatInfo.uex' path='docs/doc[@for="SpeechAudioFormatInfo.Equals"]/*' /> public override bool Equals (object obj) { RuleElement refObj = obj as RuleElement; if (refObj == null) { return false; } if (!base.Equals (obj)) { return false; } return _name == refObj._name; } /// 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 override GrammarBuilderBase Clone () { RuleElement rule = new RuleElement (_name); rule.CloneItems (this); return rule; } /// /// /// /// /// /// /// ///internal override IElement CreateElement (IElementFactory elementFactory, IElement parent, IRule rule, IdentifierCollection ruleIds) { if (_rule == null) { IGrammar grammar = elementFactory.Grammar; // Create the rule _ruleName = ruleIds.CreateNewIdentifier (Name); _rule = grammar.CreateRule (_ruleName, RulePublic.False, RuleDynamic.NotSet, false); // Create the children elements CreateChildrenElements (elementFactory, _rule, ruleIds); _rule.PostParse (grammar); } return _rule; } /// /// /// ///internal override int CalcCount (BuilderElements parent) { // clear any existing value _rule = null; return base.CalcCount (parent); } #endregion //******************************************************************* // // Internal Properties // //******************************************************************** #region Internal Properties override internal string DebugSummary { get { return _name + "=" + base.DebugSummary; } } internal string Name { get { return _name; } } internal string RuleName { get { return _ruleName; } } #endregion //******************************************************************* // // Private Fields // //******************************************************************* #region Private Fields /// /// /// private readonly string _name; private string _ruleName; private IRule _rule; #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
- DynamicObject.cs
- Number.cs
- TextRange.cs
- HttpAsyncResult.cs
- MediaScriptCommandRoutedEventArgs.cs
- MultiPageTextView.cs
- HybridDictionary.cs
- IgnoreSectionHandler.cs
- StreamResourceInfo.cs
- TextTreeObjectNode.cs
- GenericRootAutomationPeer.cs
- SQLUtility.cs
- WindowsPen.cs
- PropertyTabChangedEvent.cs
- IfAction.cs
- ActivityDesignerResources.cs
- SqlNodeTypeOperators.cs
- DoubleAnimationBase.cs
- UriSection.cs
- ConsoleCancelEventArgs.cs
- XslAst.cs
- XslNumber.cs
- X509CertificateStore.cs
- ExpressionEditorAttribute.cs
- DbQueryCommandTree.cs
- MailBnfHelper.cs
- PrimitiveXmlSerializers.cs
- SparseMemoryStream.cs
- AutomationFocusChangedEventArgs.cs
- CommonXSendMessage.cs
- ToolStripContentPanelRenderEventArgs.cs
- SHA256Managed.cs
- Knowncolors.cs
- Pair.cs
- AutoResizedEvent.cs
- StaticSiteMapProvider.cs
- ColumnCollection.cs
- PerfService.cs
- PopupRoot.cs
- TagNameToTypeMapper.cs
- CardSpacePolicyElement.cs
- DeflateEmulationStream.cs
- Privilege.cs
- InvalidOleVariantTypeException.cs
- DataGridViewDataErrorEventArgs.cs
- XmlSchemaAttributeGroupRef.cs
- odbcmetadatafactory.cs
- XmlObjectSerializerWriteContext.cs
- TraceData.cs
- IndicShape.cs
- OracleException.cs
- ISessionStateStore.cs
- NonPrimarySelectionGlyph.cs
- LinqDataSourceDisposeEventArgs.cs
- SafeIUnknown.cs
- rsa.cs
- DebugView.cs
- ExternalException.cs
- CatalogZoneBase.cs
- OLEDB_Enum.cs
- UIElement3D.cs
- CheckBox.cs
- Menu.cs
- Int64AnimationBase.cs
- NotImplementedException.cs
- DataServiceStreamProviderWrapper.cs
- SynthesizerStateChangedEventArgs.cs
- StylusPointPropertyInfoDefaults.cs
- FrameworkElementFactoryMarkupObject.cs
- TableRowCollection.cs
- XappLauncher.cs
- DataRowCollection.cs
- AttachedPropertyBrowsableWhenAttributePresentAttribute.cs
- Subtree.cs
- ProgressBarHighlightConverter.cs
- BoolLiteral.cs
- DefaultTextStoreTextComposition.cs
- AsymmetricSignatureFormatter.cs
- CommunicationObject.cs
- DateTime.cs
- FunctionImportElement.cs
- DataGridViewMethods.cs
- HttpVersion.cs
- ObjectContext.cs
- MemoryFailPoint.cs
- RegistrySecurity.cs
- TextEffectResolver.cs
- BitmapData.cs
- SourceSwitch.cs
- OleDbFactory.cs
- CompiledQueryCacheKey.cs
- Schema.cs
- UniqueIdentifierService.cs
- SpecularMaterial.cs
- InputLanguageProfileNotifySink.cs
- dataSvcMapFileLoader.cs
- InternalBase.cs
- ElementHostAutomationPeer.cs
- PropertyChangedEventArgs.cs
- RuntimeConfigLKG.cs