Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / 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
- DiscoveryClientRequestChannel.cs
- DocumentPageViewAutomationPeer.cs
- XmlAttributeOverrides.cs
- DateTimePicker.cs
- ApplicationManager.cs
- SafePointer.cs
- WindowHideOrCloseTracker.cs
- Unit.cs
- Convert.cs
- FileCodeGroup.cs
- NetworkInformationException.cs
- TreeNodeBindingDepthConverter.cs
- InputLanguageCollection.cs
- WebBrowserHelper.cs
- MessageBox.cs
- SqlConnection.cs
- OleDbFactory.cs
- TextSelectionHighlightLayer.cs
- MutexSecurity.cs
- RSAPKCS1SignatureDeformatter.cs
- DbDataReader.cs
- ClientOptions.cs
- RequestUriProcessor.cs
- Dictionary.cs
- NetPipeSectionData.cs
- RequestResizeEvent.cs
- IsolatedStorageFile.cs
- ListenerAdapterBase.cs
- PerformanceCountersElement.cs
- TextDecoration.cs
- SqlError.cs
- DataServiceQueryOfT.cs
- StylusPointProperties.cs
- PieceNameHelper.cs
- ToolStripProfessionalLowResolutionRenderer.cs
- DirectoryNotFoundException.cs
- NonParentingControl.cs
- BitmapData.cs
- SecurityTokenSerializer.cs
- SHA1.cs
- InkCanvasSelectionAdorner.cs
- EventToken.cs
- PointLight.cs
- DataGridViewCheckBoxColumn.cs
- GridErrorDlg.cs
- XmlQualifiedName.cs
- AVElementHelper.cs
- PageRanges.cs
- DictionaryContent.cs
- Converter.cs
- EventMappingSettingsCollection.cs
- TypeReference.cs
- ControlBuilder.cs
- Setter.cs
- EndOfStreamException.cs
- ThreadAbortException.cs
- GridViewColumnHeader.cs
- SafeTimerHandle.cs
- Soap.cs
- WebPartZoneBase.cs
- ToolStripItemImageRenderEventArgs.cs
- arabicshape.cs
- WebSysDescriptionAttribute.cs
- SecurityResources.cs
- Journal.cs
- DataPager.cs
- UnhandledExceptionEventArgs.cs
- CallbackValidator.cs
- WebHttpSecurityElement.cs
- OleDbError.cs
- WebRequestModuleElementCollection.cs
- DetectEofStream.cs
- Binding.cs
- ZoneButton.cs
- ListBindableAttribute.cs
- RevocationPoint.cs
- XmlSchemaObjectTable.cs
- MailAddress.cs
- MissingMemberException.cs
- X509AsymmetricSecurityKey.cs
- ConfigXmlComment.cs
- TcpChannelListener.cs
- SqlHelper.cs
- TransportChannelListener.cs
- DropAnimation.xaml.cs
- ResourceDefaultValueAttribute.cs
- HelpKeywordAttribute.cs
- SerializationSectionGroup.cs
- SqlProcedureAttribute.cs
- DataSourceSelectArguments.cs
- RectAnimation.cs
- ConnectionManager.cs
- AssociationSet.cs
- IssuanceLicense.cs
- Int32CAMarshaler.cs
- MultiView.cs
- FastEncoder.cs
- WebPartUtil.cs
- Delay.cs
- LinearGradientBrush.cs