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 (List builders, 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 (List builders, 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
- ViewStateException.cs
- DragEvent.cs
- XmlUtil.cs
- QueryTreeBuilder.cs
- DesignBindingConverter.cs
- PtsHost.cs
- CodeParameterDeclarationExpression.cs
- HtmlInputFile.cs
- StylusLogic.cs
- ItemTypeToolStripMenuItem.cs
- VisualTarget.cs
- IsolatedStorageFile.cs
- ObjectViewFactory.cs
- AssemblyCollection.cs
- MsmqIntegrationBindingElement.cs
- DiagnosticsConfiguration.cs
- JournalEntryStack.cs
- XmlStreamedByteStreamReader.cs
- EndPoint.cs
- TaskFileService.cs
- Matrix3D.cs
- CacheOutputQuery.cs
- ClickablePoint.cs
- ChannelManagerService.cs
- TextEditorTables.cs
- Opcode.cs
- SqlTransaction.cs
- safemediahandle.cs
- ProjectionPathSegment.cs
- ProviderUtil.cs
- hwndwrapper.cs
- DrawToolTipEventArgs.cs
- Journal.cs
- Parameter.cs
- LinqDataSourceDeleteEventArgs.cs
- xdrvalidator.cs
- ZipPackagePart.cs
- SharedUtils.cs
- ServiceNameCollection.cs
- PolygonHotSpot.cs
- StringReader.cs
- Timer.cs
- FontFamilyConverter.cs
- Facet.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- TransformedBitmap.cs
- DesignerProperties.cs
- DSACryptoServiceProvider.cs
- HasCopySemanticsAttribute.cs
- CodeMemberEvent.cs
- SuppressMergeCheckAttribute.cs
- CapabilitiesAssignment.cs
- DataBindingCollection.cs
- Message.cs
- OdbcError.cs
- SafeHandles.cs
- QilGenerator.cs
- Array.cs
- ChangesetResponse.cs
- autovalidator.cs
- MemberProjectionIndex.cs
- DefaultProxySection.cs
- _CommandStream.cs
- SplineKeyFrames.cs
- MultipartContentParser.cs
- GridView.cs
- PipelineComponent.cs
- AnnotationAuthorChangedEventArgs.cs
- DataGridViewButtonColumn.cs
- DataPointer.cs
- RuleProcessor.cs
- DefaultPrintController.cs
- Metadata.cs
- ExtensionSimplifierMarkupObject.cs
- WebBrowserDocumentCompletedEventHandler.cs
- QilXmlReader.cs
- PriorityQueue.cs
- TextViewBase.cs
- HtmlTernaryTree.cs
- ServerReliableChannelBinder.cs
- ServiceBehaviorElementCollection.cs
- OverloadGroupAttribute.cs
- ControlDesigner.cs
- CodeExpressionStatement.cs
- ObjectIDGenerator.cs
- ComponentDesigner.cs
- HttpCacheVaryByContentEncodings.cs
- CapacityStreamGeometryContext.cs
- CodeDirectiveCollection.cs
- NonClientArea.cs
- SerialPort.cs
- GlobalEventManager.cs
- ImageClickEventArgs.cs
- HttpContextWrapper.cs
- AssemblyEvidenceFactory.cs
- XmlnsDictionary.cs
- MetadataHelper.cs
- CompiledQueryCacheEntry.cs
- LocalizationCodeDomSerializer.cs
- HandlerWithFactory.cs