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 / itemelement.cs / 1 / itemelement.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 ItemElement : BuilderElements { //******************************************************************* // // Constructors // //******************************************************************* #region Constructors ////// /// /// internal ItemElement (GrammarBuilderBase builder) : this (builder, 1, 1) { } ////// /// /// /// internal ItemElement (int minRepeat, int maxRepeat) : this ((GrammarBuilderBase) null, minRepeat, maxRepeat) { } ////// /// /// /// /// internal ItemElement (GrammarBuilderBase builder, int minRepeat, int maxRepeat) { if (builder != null) { Add (builder); } _minRepeat = minRepeat; _maxRepeat = maxRepeat; } ////// /// /// /// /// internal ItemElement (Listbuilders, int minRepeat, int maxRepeat) { foreach (GrammarBuilderBase builder in builders) { Items.Add (builder); } _minRepeat = minRepeat; _maxRepeat = maxRepeat; } /// /// /// /// internal ItemElement (GrammarBuilder builders) { foreach (GrammarBuilderBase builder in builders.InternalBuilder.Items) { Items.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) { ItemElement refObj = obj as ItemElement; if (refObj == null) { return false; } if (!base.Equals (obj)) { return false; } return _minRepeat == refObj._minRepeat && _maxRepeat == refObj._maxRepeat; } /// 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 () { ItemElement item = new ItemElement (_minRepeat, _maxRepeat); item.CloneItems (this); return item; } /// /// /// /// /// /// /// ///internal override IElement CreateElement (IElementFactory elementFactory, IElement parent, IRule rule, IdentifierCollection ruleIds) { // Create and return the real item (the item including the grammar) // for the current grammar IItem item = elementFactory.CreateItem (parent, rule, _minRepeat, _maxRepeat, 0.5f, 1f); // Create the children elements CreateChildrenElements (elementFactory, item, rule, ruleIds); return item; } #endregion //******************************************************************* // // Private Fields // //******************************************************************** #region Private Fields private readonly int _minRepeat = 1; private readonly int _maxRepeat = 1; #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 ItemElement : BuilderElements { //******************************************************************* // // Constructors // //******************************************************************* #region Constructors ////// /// /// internal ItemElement (GrammarBuilderBase builder) : this (builder, 1, 1) { } ////// /// /// /// internal ItemElement (int minRepeat, int maxRepeat) : this ((GrammarBuilderBase) null, minRepeat, maxRepeat) { } ////// /// /// /// /// internal ItemElement (GrammarBuilderBase builder, int minRepeat, int maxRepeat) { if (builder != null) { Add (builder); } _minRepeat = minRepeat; _maxRepeat = maxRepeat; } ////// /// /// /// /// internal ItemElement (Listbuilders, int minRepeat, int maxRepeat) { foreach (GrammarBuilderBase builder in builders) { Items.Add (builder); } _minRepeat = minRepeat; _maxRepeat = maxRepeat; } /// /// /// /// internal ItemElement (GrammarBuilder builders) { foreach (GrammarBuilderBase builder in builders.InternalBuilder.Items) { Items.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) { ItemElement refObj = obj as ItemElement; if (refObj == null) { return false; } if (!base.Equals (obj)) { return false; } return _minRepeat == refObj._minRepeat && _maxRepeat == refObj._maxRepeat; } /// 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 () { ItemElement item = new ItemElement (_minRepeat, _maxRepeat); item.CloneItems (this); return item; } /// /// /// /// /// /// /// ///internal override IElement CreateElement (IElementFactory elementFactory, IElement parent, IRule rule, IdentifierCollection ruleIds) { // Create and return the real item (the item including the grammar) // for the current grammar IItem item = elementFactory.CreateItem (parent, rule, _minRepeat, _maxRepeat, 0.5f, 1f); // Create the children elements CreateChildrenElements (elementFactory, item, rule, ruleIds); return item; } #endregion //******************************************************************* // // Private Fields // //******************************************************************** #region Private Fields private readonly int _minRepeat = 1; private readonly int _maxRepeat = 1; #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
- Literal.cs
- StringValidatorAttribute.cs
- ToolBarOverflowPanel.cs
- LOSFormatter.cs
- StoreItemCollection.cs
- ClientTargetSection.cs
- IODescriptionAttribute.cs
- LineServicesRun.cs
- HttpWrapper.cs
- RelationshipEndMember.cs
- ChannelOptions.cs
- BamlLocalizationDictionary.cs
- CultureSpecificStringDictionary.cs
- PreviewPageInfo.cs
- WsdlParser.cs
- MailFileEditor.cs
- MobileFormsAuthentication.cs
- Missing.cs
- SchemaElementLookUpTableEnumerator.cs
- AttributeAction.cs
- NamedPipeActivation.cs
- BinaryCommonClasses.cs
- MemberJoinTreeNode.cs
- StringHelper.cs
- MenuItem.cs
- SafeSerializationManager.cs
- TreeViewImageGenerator.cs
- NativeStructs.cs
- Codec.cs
- ForeignKeyConstraint.cs
- HasCopySemanticsAttribute.cs
- basecomparevalidator.cs
- WindowsIPAddress.cs
- TargetParameterCountException.cs
- OleDbReferenceCollection.cs
- SQLStringStorage.cs
- XmlTextReader.cs
- BinaryReader.cs
- PromptEventArgs.cs
- ClipboardProcessor.cs
- TextEditorSelection.cs
- Exception.cs
- PeerApplicationLaunchInfo.cs
- BamlResourceDeserializer.cs
- CodeExporter.cs
- ActiveXMessageFormatter.cs
- WindowsListViewScroll.cs
- AmbientLight.cs
- DesignSurfaceServiceContainer.cs
- ServiceDescriptionImporter.cs
- GeneralTransform2DTo3D.cs
- WizardPanelChangingEventArgs.cs
- XmlBinaryReader.cs
- DataRowChangeEvent.cs
- PieceDirectory.cs
- StringFormat.cs
- ThreadStartException.cs
- _IPv6Address.cs
- SiteMapDataSourceView.cs
- OdbcException.cs
- CompositionTarget.cs
- WebBrowserNavigatedEventHandler.cs
- Parser.cs
- OracleException.cs
- UpdatableGenericsFeature.cs
- SimpleApplicationHost.cs
- HyperLinkColumn.cs
- unsafeIndexingFilterStream.cs
- JournalNavigationScope.cs
- PathGeometry.cs
- Compiler.cs
- Connector.cs
- VBIdentifierName.cs
- ToolStripContainer.cs
- ApplicationServiceHelper.cs
- X509Certificate2Collection.cs
- PolyQuadraticBezierSegment.cs
- QueryFunctions.cs
- TypedOperationInfo.cs
- ReadOnlyMetadataCollection.cs
- ControlLocalizer.cs
- ParentQuery.cs
- SqlDataSourceView.cs
- OleDbConnection.cs
- DeviceContext.cs
- StorageEntityContainerMapping.cs
- WebMethodAttribute.cs
- PagesChangedEventArgs.cs
- DesignerHelpers.cs
- QualifierSet.cs
- DetailsViewDeleteEventArgs.cs
- FreezableOperations.cs
- ExtensionWindowHeader.cs
- Size3D.cs
- SmiGettersStream.cs
- ConsumerConnectionPoint.cs
- _DisconnectOverlappedAsyncResult.cs
- PerfService.cs
- SQlBooleanStorage.cs
- MaterialGroup.cs