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
- MultipartIdentifier.cs
- wpf-etw.cs
- InputLanguageManager.cs
- DependencyObjectPropertyDescriptor.cs
- SecurityUtils.cs
- HttpHandlersSection.cs
- GenericQueueSurrogate.cs
- SqlPersonalizationProvider.cs
- ManipulationStartedEventArgs.cs
- FontDialog.cs
- OracleCommandSet.cs
- QilUnary.cs
- SqlConnectionStringBuilder.cs
- DbParameterHelper.cs
- NaturalLanguageHyphenator.cs
- InkCanvasAutomationPeer.cs
- adornercollection.cs
- OleDbDataReader.cs
- SignatureToken.cs
- SafeHandles.cs
- Int64.cs
- COM2ExtendedTypeConverter.cs
- WorkflowInlining.cs
- NameValuePermission.cs
- ResourceExpressionBuilder.cs
- InheritablePropertyChangeInfo.cs
- MissingSatelliteAssemblyException.cs
- WebPartManager.cs
- XmlNodeReader.cs
- URI.cs
- SEHException.cs
- panel.cs
- EmptyReadOnlyDictionaryInternal.cs
- AuthenticateEventArgs.cs
- FormatterServices.cs
- MimeFormReflector.cs
- RadioButtonFlatAdapter.cs
- PageTheme.cs
- EventBuilder.cs
- sqlpipe.cs
- XmlCustomFormatter.cs
- DataGridViewRow.cs
- FloaterParagraph.cs
- WebBrowserProgressChangedEventHandler.cs
- ExceptionList.cs
- CommentEmitter.cs
- DataMemberListEditor.cs
- ObjectStateEntryDbDataRecord.cs
- BehaviorEditorPart.cs
- ResourceExpression.cs
- documentsequencetextview.cs
- XXXInfos.cs
- SimpleHandlerBuildProvider.cs
- RenderOptions.cs
- SoapReflectionImporter.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- NativeMethods.cs
- TimerElapsedEvenArgs.cs
- UshortList2.cs
- WsatAdminException.cs
- TemplateBindingExtensionConverter.cs
- PageEventArgs.cs
- NativeCppClassAttribute.cs
- FormatException.cs
- DbConnectionHelper.cs
- HtmlFormAdapter.cs
- Maps.cs
- Process.cs
- AppDomainFactory.cs
- ConfigXmlElement.cs
- LicenseProviderAttribute.cs
- StylusTip.cs
- GlobalizationSection.cs
- GreenMethods.cs
- InheritanceAttribute.cs
- ControlCodeDomSerializer.cs
- GcHandle.cs
- DecoderExceptionFallback.cs
- StandardCommands.cs
- PackageProperties.cs
- NameNode.cs
- ConnectionManagementElement.cs
- DataListCommandEventArgs.cs
- SiteOfOriginPart.cs
- FixedSOMLineCollection.cs
- JsonQueryStringConverter.cs
- PagesSection.cs
- CustomAttributeFormatException.cs
- AnnotationAuthorChangedEventArgs.cs
- LocalizableResourceBuilder.cs
- BindingCompleteEventArgs.cs
- MD5CryptoServiceProvider.cs
- SharedUtils.cs
- TimelineGroup.cs
- oledbconnectionstring.cs
- URIFormatException.cs
- DataGridViewAutoSizeModeEventArgs.cs
- ADConnectionHelper.cs
- ClaimTypes.cs
- RegexFCD.cs