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
- ItemCheckEvent.cs
- ProtocolInformationReader.cs
- WorkflowQueue.cs
- DataGridViewSelectedColumnCollection.cs
- CapabilitiesAssignment.cs
- ExecutionEngineException.cs
- UnsupportedPolicyOptionsException.cs
- WebPermission.cs
- XmlSchemaGroup.cs
- CreateUserWizardStep.cs
- TextWriterEngine.cs
- formatter.cs
- DBDataPermission.cs
- GlyphCache.cs
- Panel.cs
- OptimizerPatterns.cs
- ProcessStartInfo.cs
- GraphicsPathIterator.cs
- GeometryDrawing.cs
- FixedSOMTableRow.cs
- PointIndependentAnimationStorage.cs
- ColumnTypeConverter.cs
- Model3DGroup.cs
- FunctionQuery.cs
- WS2007HttpBindingElement.cs
- Flattener.cs
- ShapingEngine.cs
- MessageHeaderT.cs
- ScriptResourceHandler.cs
- Int32Collection.cs
- Tracer.cs
- NativeRightsManagementAPIsStructures.cs
- SoapFault.cs
- DbConvert.cs
- CryptoApi.cs
- VariableBinder.cs
- FileDialogCustomPlace.cs
- XmlSchemaCollection.cs
- FrugalMap.cs
- OAVariantLib.cs
- WebReferenceOptions.cs
- StyleCollection.cs
- ConfigurationElement.cs
- BrowserDefinitionCollection.cs
- MetadataItemEmitter.cs
- WindowsFont.cs
- CacheOutputQuery.cs
- InputReferenceExpression.cs
- XmlSchemaChoice.cs
- CatalogZoneAutoFormat.cs
- ObservableCollection.cs
- RegexCompiler.cs
- CachedPathData.cs
- AdobeCFFWrapper.cs
- _SslState.cs
- CharAnimationUsingKeyFrames.cs
- DragStartedEventArgs.cs
- localization.cs
- EventDescriptor.cs
- BinaryParser.cs
- EventDescriptorCollection.cs
- TemplateKey.cs
- DataKeyPropertyAttribute.cs
- MoveSizeWinEventHandler.cs
- EncoderParameter.cs
- TableItemProviderWrapper.cs
- TraceSection.cs
- FixedTextBuilder.cs
- XMLSyntaxException.cs
- DependencyPropertyDescriptor.cs
- ValueUtilsSmi.cs
- ArraySet.cs
- GenerateHelper.cs
- StateManagedCollection.cs
- TextWriterTraceListener.cs
- XmlArrayAttribute.cs
- BasicKeyConstraint.cs
- AudioLevelUpdatedEventArgs.cs
- OwnerDrawPropertyBag.cs
- XPathParser.cs
- MaterialGroup.cs
- BamlRecords.cs
- TextBoxBaseDesigner.cs
- MaskInputRejectedEventArgs.cs
- PackUriHelper.cs
- PolygonHotSpot.cs
- StandardRuntimeEnumValidatorAttribute.cs
- DataServiceException.cs
- TextTreeObjectNode.cs
- _Win32.cs
- Int16Storage.cs
- DeploymentSection.cs
- MouseDevice.cs
- WriterOutput.cs
- StylusSystemGestureEventArgs.cs
- XmlWrappingReader.cs
- WebPartCancelEventArgs.cs
- OrderedDictionary.cs
- Constants.cs
- DeflateStream.cs