Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Speech / Src / Internal / GrammarBuilding / TagElement.cs / 1 / TagElement.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 { ////// /// #if VSCOMPILE [DebuggerDisplay ("{DebugSummary}")] #endif internal sealed class TagElement : BuilderElements { //******************************************************************* // // Constructors // //******************************************************************* #region Constructors ////// /// /// internal TagElement (object value) { _value = value; } ////// /// /// /// internal TagElement (GrammarBuilderBase builder, object value) : this (value) { Add (builder); } ////// /// /// /// internal TagElement (GrammarBuilder builder, object value) : this (value) { 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) { TagElement refObj = obj as TagElement; if (refObj == null) { return false; } if (!base.Equals (obj)) { return false; } return _value.Equals (refObj._value); } /// 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 () { TagElement tag = new TagElement (_value); tag.CloneItems (this); return tag; } /// /// /// /// /// /// /// ///internal override IElement CreateElement (IElementFactory elementFactory, IElement parent, IRule rule, IdentifierCollection ruleIds) { // Create the children elements IItem item = parent as IItem; if (item != null) { CreateChildrenElements (elementFactory, item, rule, ruleIds); } else { if (parent == rule) { CreateChildrenElements (elementFactory, rule, ruleIds); } else { System.Diagnostics.Debug.Assert (false); } } // Create the tag element at the end only if there were some children IPropertyTag tag = elementFactory.CreatePropertyTag (parent); tag.NameValue (parent, null, _value); return tag; } #endregion //******************************************************************* // // Internal Properties // //******************************************************************** #region Internal Properties override internal string DebugSummary { get { return base.DebugSummary + " {" + _value + "}"; } } #endregion //******************************************************************* // // Private Fields // //******************************************************************* #region Private Fields private readonly object _value; #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 { ////// /// #if VSCOMPILE [DebuggerDisplay ("{DebugSummary}")] #endif internal sealed class TagElement : BuilderElements { //******************************************************************* // // Constructors // //******************************************************************* #region Constructors ////// /// /// internal TagElement (object value) { _value = value; } ////// /// /// /// internal TagElement (GrammarBuilderBase builder, object value) : this (value) { Add (builder); } ////// /// /// /// internal TagElement (GrammarBuilder builder, object value) : this (value) { 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) { TagElement refObj = obj as TagElement; if (refObj == null) { return false; } if (!base.Equals (obj)) { return false; } return _value.Equals (refObj._value); } /// 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 () { TagElement tag = new TagElement (_value); tag.CloneItems (this); return tag; } /// /// /// /// /// /// /// ///internal override IElement CreateElement (IElementFactory elementFactory, IElement parent, IRule rule, IdentifierCollection ruleIds) { // Create the children elements IItem item = parent as IItem; if (item != null) { CreateChildrenElements (elementFactory, item, rule, ruleIds); } else { if (parent == rule) { CreateChildrenElements (elementFactory, rule, ruleIds); } else { System.Diagnostics.Debug.Assert (false); } } // Create the tag element at the end only if there were some children IPropertyTag tag = elementFactory.CreatePropertyTag (parent); tag.NameValue (parent, null, _value); return tag; } #endregion //******************************************************************* // // Internal Properties // //******************************************************************** #region Internal Properties override internal string DebugSummary { get { return base.DebugSummary + " {" + _value + "}"; } } #endregion //******************************************************************* // // Private Fields // //******************************************************************* #region Private Fields private readonly object _value; #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
- SafeLocalAllocation.cs
- SqlProfileProvider.cs
- QueryInterceptorAttribute.cs
- StyleSheetComponentEditor.cs
- DependencyProperty.cs
- EventHandlerList.cs
- StubHelpers.cs
- Thumb.cs
- TextTreeDeleteContentUndoUnit.cs
- ConfigurationElementCollection.cs
- BitmapEffectGroup.cs
- XappLauncher.cs
- Invariant.cs
- LoginStatusDesigner.cs
- TransformedBitmap.cs
- TextBlockAutomationPeer.cs
- MouseButtonEventArgs.cs
- URLMembershipCondition.cs
- DeferrableContent.cs
- PropertyEntry.cs
- Wow64ConfigurationLoader.cs
- CompensationHandlingFilter.cs
- MailAddressCollection.cs
- BasicBrowserDialog.designer.cs
- EditableRegion.cs
- WebPageTraceListener.cs
- DbConnectionFactory.cs
- SessionEndedEventArgs.cs
- TemplateBuilder.cs
- TripleDESCryptoServiceProvider.cs
- MemoryPressure.cs
- ColumnClickEvent.cs
- WebControlParameterProxy.cs
- AmbientProperties.cs
- ResourceCategoryAttribute.cs
- HttpCacheVary.cs
- UnicodeEncoding.cs
- SoapExtension.cs
- TryExpression.cs
- RoleServiceManager.cs
- EntityModelSchemaGenerator.cs
- CloudCollection.cs
- Propagator.cs
- PassportAuthenticationEventArgs.cs
- DataBindEngine.cs
- WindowsFormsHelpers.cs
- DataGridViewRowStateChangedEventArgs.cs
- DataError.cs
- IdleTimeoutMonitor.cs
- ProcessThread.cs
- DictionaryContent.cs
- InstanceDescriptor.cs
- ApplyTemplatesAction.cs
- FileLoadException.cs
- SynchronizationFilter.cs
- BitmapEncoder.cs
- VisualBrush.cs
- ByteViewer.cs
- PermissionAttributes.cs
- VisualCollection.cs
- ResetableIterator.cs
- Model3DCollection.cs
- OracleDataAdapter.cs
- XmlSchemaObject.cs
- XmlSchemaAttributeGroupRef.cs
- WorkflowTransactionService.cs
- ColorEditor.cs
- UidManager.cs
- DataRow.cs
- DebugManager.cs
- VScrollProperties.cs
- TemplatedEditableDesignerRegion.cs
- ArgumentException.cs
- DesignerResources.cs
- XhtmlBasicValidatorAdapter.cs
- SqlBuilder.cs
- DocumentViewerAutomationPeer.cs
- XPathNodeIterator.cs
- ApplicationFileParser.cs
- DynamicEndpointElement.cs
- InstalledVoice.cs
- GridLengthConverter.cs
- DrawingVisual.cs
- SynchronizedPool.cs
- WeakReferenceEnumerator.cs
- DesignerAttribute.cs
- ValueOfAction.cs
- Trace.cs
- CodeMemberProperty.cs
- CriticalExceptions.cs
- Ipv6Element.cs
- WebPartMovingEventArgs.cs
- _NegoState.cs
- SendKeys.cs
- PinProtectionHelper.cs
- CriticalHandle.cs
- TableLayoutStyle.cs
- SystemColorTracker.cs
- EndpointIdentityConverter.cs
- BinHexDecoder.cs