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
- FontFaceLayoutInfo.cs
- OdbcPermission.cs
- HtmlSelectionListAdapter.cs
- ImageSource.cs
- DbParameterHelper.cs
- OpenFileDialog.cs
- RequestDescription.cs
- WindowPattern.cs
- UnsafeNativeMethods.cs
- SQLDateTimeStorage.cs
- FloaterParagraph.cs
- BamlLocalizer.cs
- DispatcherEventArgs.cs
- Pair.cs
- ExecutorLocksHeldException.cs
- Parser.cs
- SafeFileMappingHandle.cs
- XPathAxisIterator.cs
- EntityEntry.cs
- PriorityQueue.cs
- ListViewTableCell.cs
- CodeCompiler.cs
- CommandConverter.cs
- UriGenerator.cs
- securitycriticaldataClass.cs
- ResourceContainer.cs
- RegisteredScript.cs
- RequestDescription.cs
- AuthenticationSchemesHelper.cs
- TypeNameHelper.cs
- AttachmentService.cs
- ChtmlTextWriter.cs
- FirstQueryOperator.cs
- ProfileGroupSettings.cs
- Int64Animation.cs
- ClientSettingsProvider.cs
- EventsTab.cs
- ValidatorCollection.cs
- EnumConverter.cs
- BasicKeyConstraint.cs
- ObfuscationAttribute.cs
- Panel.cs
- ProtocolsConfigurationEntry.cs
- PrintDialog.cs
- SchemaImporterExtensionElement.cs
- DeviceContexts.cs
- Parser.cs
- WebHostScriptMappingsInstallComponent.cs
- DataGridTable.cs
- ConfigurationSettings.cs
- MultiBinding.cs
- UnconditionalPolicy.cs
- TreeViewCancelEvent.cs
- DataGridViewRowEventArgs.cs
- MailAddress.cs
- ComplexObject.cs
- OdbcReferenceCollection.cs
- DbTypeMap.cs
- CommandField.cs
- SchemaObjectWriter.cs
- ToolStripItemDataObject.cs
- SR.cs
- ContentPresenter.cs
- BuildDependencySet.cs
- ObjectConverter.cs
- View.cs
- ByteAnimationBase.cs
- mediaeventargs.cs
- GlyphRun.cs
- PackageDigitalSignature.cs
- PointAnimationClockResource.cs
- NumericUpDownAccelerationCollection.cs
- TraceLog.cs
- WindowsUserNameSecurityTokenAuthenticator.cs
- SchemaImporterExtensionsSection.cs
- DispatcherFrame.cs
- RIPEMD160.cs
- ThrowOnMultipleAssignment.cs
- Misc.cs
- TdsParser.cs
- BrowserInteropHelper.cs
- BrowserCapabilitiesFactoryBase.cs
- DBSchemaRow.cs
- ContainerSelectorBehavior.cs
- WebBrowserSiteBase.cs
- ActiveXHost.cs
- WebBaseEventKeyComparer.cs
- OleDbWrapper.cs
- ConversionContext.cs
- ForeignKeyConstraint.cs
- AssemblyFilter.cs
- SingleObjectCollection.cs
- Logging.cs
- WorkflowViewStateService.cs
- Annotation.cs
- ObfuscateAssemblyAttribute.cs
- ListViewCommandEventArgs.cs
- Internal.cs
- HwndSubclass.cs
- DefaultWorkflowTransactionService.cs