Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Speech / Src / Recognition / Choices.cs / 1 / Choices.cs
//------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------
using System.Collections.Generic;
using System.Diagnostics;
using System.Speech.Internal.GrammarBuilding;
using System.Speech.Internal;
namespace System.Speech.Recognition
{
///
///
///
[DebuggerDisplay ("{_oneOf.DebugSummary}")]
public class Choices
{
//*******************************************************************
//
// Constructors
//
//*******************************************************************
#region Constructors
///
///
///
public Choices ()
{
}
///
///
///
///
public Choices (params string [] phrases)
{
Helpers.ThrowIfNull (phrases, "phrases");
Add (phrases);
}
///
///
///
///
public Choices (params GrammarBuilder [] alternateChoices)
{
Helpers.ThrowIfNull (alternateChoices, "alternateChoices");
Add (alternateChoices);
}
#endregion
//********************************************************************
//
// Public Methods
//
//*******************************************************************
#region Public Methods
///
///
///
///
public void Add (params string [] phrases)
{
Helpers.ThrowIfNull (phrases, "phrases");
foreach (string phrase in phrases)
{
Helpers.ThrowIfEmptyOrNull (phrase, "phrase");
_oneOf.Add (phrase);
}
}
///
///
///
///
public void Add (params GrammarBuilder [] alternateChoices)
{
Helpers.ThrowIfNull (alternateChoices, "alternateChoices");
foreach (GrammarBuilder alternateChoice in alternateChoices)
{
Helpers.ThrowIfNull (alternateChoice, "alternateChoice");
_oneOf.Items.Add (new ItemElement (alternateChoice));
}
}
///
/// TODOC
///
///
public GrammarBuilder ToGrammarBuilder ()
{
return new GrammarBuilder (this);
}
#endregion
//********************************************************************
//
// Internal Properties
//
//********************************************************************
#region Internal Properties
internal OneOfElement OneOf
{
get
{
return _oneOf;
}
}
#endregion
//*******************************************************************
//
// Private Fields
//
//********************************************************************
#region Private Fields
private OneOfElement _oneOf = new OneOfElement ();
#endregion
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DecoderFallbackWithFailureFlag.cs
- DbQueryCommandTree.cs
- CombinedGeometry.cs
- VisualProxy.cs
- ReadWriteObjectLock.cs
- IntermediatePolicyValidator.cs
- XmlValidatingReader.cs
- NetCodeGroup.cs
- TypeNameConverter.cs
- GlyphsSerializer.cs
- DataGridViewComponentPropertyGridSite.cs
- ImageIndexEditor.cs
- SqlException.cs
- ResourceContainer.cs
- ValueUnavailableException.cs
- InsufficientExecutionStackException.cs
- PathStreamGeometryContext.cs
- PartialCachingControl.cs
- FontSizeConverter.cs
- FormatSettings.cs
- MultitargetingHelpers.cs
- SharedPersonalizationStateInfo.cs
- IMembershipProvider.cs
- HeaderCollection.cs
- EntitySetDataBindingList.cs
- CollectionViewProxy.cs
- CallInfo.cs
- RightsManagementEncryptionTransform.cs
- KeyNotFoundException.cs
- XmlDataSourceNodeDescriptor.cs
- Compiler.cs
- SubMenuStyleCollectionEditor.cs
- RectAnimationUsingKeyFrames.cs
- ShaderEffect.cs
- InternalConfigEventArgs.cs
- BatchStream.cs
- IconConverter.cs
- DataColumn.cs
- UnmanagedMemoryStreamWrapper.cs
- Config.cs
- StringWriter.cs
- ClientCultureInfo.cs
- ShaperBuffers.cs
- AttributeSetAction.cs
- Focus.cs
- recordstatescratchpad.cs
- StreamWriter.cs
- XhtmlTextWriter.cs
- ContainerAction.cs
- WebPartEditVerb.cs
- LinqDataSourceEditData.cs
- SynchronizationLockException.cs
- MergeLocalizationDirectives.cs
- SafeSerializationManager.cs
- ViewValidator.cs
- ObsoleteAttribute.cs
- KnownTypeDataContractResolver.cs
- ResourcePart.cs
- GeneralTransform3DCollection.cs
- SqlClientWrapperSmiStream.cs
- WeakReferenceList.cs
- SmiTypedGetterSetter.cs
- SR.cs
- SafeNativeMethods.cs
- ResourceManager.cs
- GlobalItem.cs
- Translator.cs
- NamespaceExpr.cs
- WinEventWrap.cs
- ControlCollection.cs
- GradientStop.cs
- FontSource.cs
- SafeFindHandle.cs
- XmlEventCache.cs
- SimpleType.cs
- DataServiceConfiguration.cs
- FastPropertyAccessor.cs
- MenuAutomationPeer.cs
- SplitterPanel.cs
- CustomDictionarySources.cs
- ColorDialog.cs
- CodeMethodReturnStatement.cs
- CapabilitiesState.cs
- JapaneseCalendar.cs
- Operator.cs
- InfoCardTraceRecord.cs
- HiddenField.cs
- DateTimeOffset.cs
- Function.cs
- AutomationFocusChangedEventArgs.cs
- SemanticAnalyzer.cs
- UnsafePeerToPeerMethods.cs
- StylusPointPropertyUnit.cs
- DataGridViewTextBoxColumn.cs
- Filter.cs
- CaretElement.cs
- SatelliteContractVersionAttribute.cs
- FilteredReadOnlyMetadataCollection.cs
- SafeViewOfFileHandle.cs
- WindowsTitleBar.cs