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
- DataGridViewEditingControlShowingEventArgs.cs
- BitmapEffectInput.cs
- RepeaterCommandEventArgs.cs
- EllipseGeometry.cs
- LoaderAllocator.cs
- ColumnMapVisitor.cs
- Storyboard.cs
- MailAddress.cs
- UndoManager.cs
- ControlAdapter.cs
- GeneralTransform2DTo3D.cs
- Rotation3DAnimationBase.cs
- StaticTextPointer.cs
- ToolTipAutomationPeer.cs
- ListCollectionView.cs
- SplitterDesigner.cs
- WebControlAdapter.cs
- HotSpotCollection.cs
- SrgsElementFactory.cs
- PropertyTabChangedEvent.cs
- CapabilitiesRule.cs
- TextEditorMouse.cs
- StreamUpgradeProvider.cs
- MetabaseServerConfig.cs
- PositiveTimeSpanValidatorAttribute.cs
- FlowLayoutSettings.cs
- EntityDataSourceContextDisposingEventArgs.cs
- webeventbuffer.cs
- updateconfighost.cs
- PersonalizationEntry.cs
- PageParserFilter.cs
- FileInfo.cs
- SEHException.cs
- EncoderReplacementFallback.cs
- webproxy.cs
- RequestResizeEvent.cs
- ListControlConvertEventArgs.cs
- DrawingCollection.cs
- GridView.cs
- TemplatingOptionsDialog.cs
- ClusterSafeNativeMethods.cs
- ResolveNameEventArgs.cs
- DescendantBaseQuery.cs
- EndPoint.cs
- IssuanceLicense.cs
- HostedElements.cs
- FileDialogPermission.cs
- IERequestCache.cs
- DataListCommandEventArgs.cs
- MessageSmuggler.cs
- MethodToken.cs
- UnconditionalPolicy.cs
- DataGridViewSelectedColumnCollection.cs
- MTConfigUtil.cs
- DataSetMappper.cs
- DataGridViewColumnCollectionDialog.cs
- ApplicationServiceManager.cs
- _ConnectionGroup.cs
- SectionInput.cs
- XmlSchemaInclude.cs
- MemoryFailPoint.cs
- DataGridViewComboBoxEditingControl.cs
- ObjectStateEntryDbDataRecord.cs
- AnnotationAuthorChangedEventArgs.cs
- RectAnimationBase.cs
- DataGridBoolColumn.cs
- PerformanceCounterPermissionEntry.cs
- FacetValueContainer.cs
- ProfileGroupSettings.cs
- ScriptingScriptResourceHandlerSection.cs
- X509CertificateCollection.cs
- Send.cs
- TransformPattern.cs
- ReceiveContent.cs
- LocationFactory.cs
- NeedSkipTokenVisitor.cs
- TimeoutException.cs
- Boolean.cs
- UxThemeWrapper.cs
- cookiecollection.cs
- BrowserTree.cs
- DispatcherTimer.cs
- GridView.cs
- SafeRightsManagementEnvironmentHandle.cs
- FieldToken.cs
- RouteTable.cs
- OleDbCommandBuilder.cs
- ToolboxItemSnapLineBehavior.cs
- SafeProcessHandle.cs
- ProcessModule.cs
- OdbcCommand.cs
- DataSourceSelectArguments.cs
- ClientRuntimeConfig.cs
- HttpModulesSection.cs
- FontFamilyIdentifier.cs
- IntegerFacetDescriptionElement.cs
- DataObject.cs
- ToolStripProgressBar.cs
- DataGridViewColumnDividerDoubleClickEventArgs.cs
- CryptoApi.cs