Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Speech / Src / Internal / GrammarBuilding / GrammarBuilderDictation.cs / 1 / GrammarBuilderDictation.cs
//------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------
#define CODE_ANALYSIS
using System.Speech.Recognition;
using System.Speech.Internal.SrgsParser;
using System.Diagnostics;
namespace System.Speech.Internal.GrammarBuilding
{
///
///
///
internal sealed class GrammarBuilderDictation : GrammarBuilderBase
{
//*******************************************************************
//
// Constructors
//
//*******************************************************************
#region Constructors
///
///
///
internal GrammarBuilderDictation ()
: this (null)
{
}
///
///
///
///
internal GrammarBuilderDictation (string category)
{
_category = category;
}
#endregion
//********************************************************************
//
// Public Methods
//
//*******************************************************************
#region Public Methods
/// TODOC <_include file='doc\SpeechAudioFormatInfo.uex' path='docs/doc[@for="SpeechAudioFormatInfo.Equals"]/*' />
public override bool Equals (object obj)
{
GrammarBuilderDictation refObj = obj as GrammarBuilderDictation;
if (refObj == null)
{
return false;
}
return _category == refObj._category;
}
/// TODOC <_include file='doc\SpeechAudioFormatInfo.uex' path='docs/doc[@for="SpeechAudioFormatInfo.GetHashCode"]/*' />
public override int GetHashCode ()
{
return _category == null ? 0 : _category.GetHashCode ();
}
#endregion
//********************************************************************
//
// Internal Methods
//
//********************************************************************
#region Internal Methods
///
///
///
///
internal override GrammarBuilderBase Clone ()
{
return new GrammarBuilderDictation (_category);
}
///
///
///
///
///
///
///
///
internal override IElement CreateElement (IElementFactory elementFactory, IElement parent, IRule rule, IdentifierCollection ruleIds)
{
// Return the IRuleRef to the dictation grammar
return CreateRuleRefToDictation (elementFactory, parent);
}
#endregion
//*******************************************************************
//
// Internal Properties
//
//********************************************************************
#region Internal Properties
override internal string DebugSummary
{
get
{
string category = _category != null ? ":" + _category : string.Empty;
return "dictation" + category;
}
}
#endregion
//*******************************************************************
//
// Private Methods
//
//*******************************************************************
#region Private Methods
///
///
///
///
///
///
private IRuleRef CreateRuleRefToDictation (IElementFactory elementFactory, IElement parent)
{
Uri ruleUri;
if (!string.IsNullOrEmpty (_category) && _category == "spelling")
{
ruleUri = new Uri ("grammar:dictation#spelling", UriKind.RelativeOrAbsolute);
}
else
{
ruleUri = new Uri ("grammar:dictation", UriKind.RelativeOrAbsolute);
}
return elementFactory.CreateRuleRef (parent, ruleUri, null, null);
}
#endregion
//*******************************************************************
//
// Private Fields
//
//********************************************************************
#region Private Fields
///
///
///
private readonly string _category;
#endregion
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------
#define CODE_ANALYSIS
using System.Speech.Recognition;
using System.Speech.Internal.SrgsParser;
using System.Diagnostics;
namespace System.Speech.Internal.GrammarBuilding
{
///
///
///
internal sealed class GrammarBuilderDictation : GrammarBuilderBase
{
//*******************************************************************
//
// Constructors
//
//*******************************************************************
#region Constructors
///
///
///
internal GrammarBuilderDictation ()
: this (null)
{
}
///
///
///
///
internal GrammarBuilderDictation (string category)
{
_category = category;
}
#endregion
//********************************************************************
//
// Public Methods
//
//*******************************************************************
#region Public Methods
/// TODOC <_include file='doc\SpeechAudioFormatInfo.uex' path='docs/doc[@for="SpeechAudioFormatInfo.Equals"]/*' />
public override bool Equals (object obj)
{
GrammarBuilderDictation refObj = obj as GrammarBuilderDictation;
if (refObj == null)
{
return false;
}
return _category == refObj._category;
}
/// TODOC <_include file='doc\SpeechAudioFormatInfo.uex' path='docs/doc[@for="SpeechAudioFormatInfo.GetHashCode"]/*' />
public override int GetHashCode ()
{
return _category == null ? 0 : _category.GetHashCode ();
}
#endregion
//********************************************************************
//
// Internal Methods
//
//********************************************************************
#region Internal Methods
///
///
///
///
internal override GrammarBuilderBase Clone ()
{
return new GrammarBuilderDictation (_category);
}
///
///
///
///
///
///
///
///
internal override IElement CreateElement (IElementFactory elementFactory, IElement parent, IRule rule, IdentifierCollection ruleIds)
{
// Return the IRuleRef to the dictation grammar
return CreateRuleRefToDictation (elementFactory, parent);
}
#endregion
//*******************************************************************
//
// Internal Properties
//
//********************************************************************
#region Internal Properties
override internal string DebugSummary
{
get
{
string category = _category != null ? ":" + _category : string.Empty;
return "dictation" + category;
}
}
#endregion
//*******************************************************************
//
// Private Methods
//
//*******************************************************************
#region Private Methods
///
///
///
///
///
///
private IRuleRef CreateRuleRefToDictation (IElementFactory elementFactory, IElement parent)
{
Uri ruleUri;
if (!string.IsNullOrEmpty (_category) && _category == "spelling")
{
ruleUri = new Uri ("grammar:dictation#spelling", UriKind.RelativeOrAbsolute);
}
else
{
ruleUri = new Uri ("grammar:dictation", UriKind.RelativeOrAbsolute);
}
return elementFactory.CreateRuleRef (parent, ruleUri, null, null);
}
#endregion
//*******************************************************************
//
// Private Fields
//
//********************************************************************
#region Private Fields
///
///
///
private readonly string _category;
#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
- UnsafeNativeMethods.cs
- SafeBitVector32.cs
- Compilation.cs
- NetStream.cs
- SectionRecord.cs
- TemplateAction.cs
- SystemMulticastIPAddressInformation.cs
- PriorityRange.cs
- CqlWriter.cs
- GridViewCellAutomationPeer.cs
- BamlMapTable.cs
- TableCellCollection.cs
- SHA1Cng.cs
- Stylesheet.cs
- PropertyInformation.cs
- SafeSystemMetrics.cs
- ReaderWriterLockSlim.cs
- LingerOption.cs
- EmptyWorkItem.cs
- PropertyInformation.cs
- ProtocolsConfigurationHandler.cs
- Utility.cs
- TableColumnCollectionInternal.cs
- ObjectContextServiceProvider.cs
- XmlSchemaRedefine.cs
- MSHTMLHost.cs
- ForeignKeyConstraint.cs
- validationstate.cs
- UIElementAutomationPeer.cs
- StreamDocument.cs
- TemplateKeyConverter.cs
- AssemblyInfo.cs
- HttpCacheVary.cs
- WindowsEditBoxRange.cs
- WebBrowserDocumentCompletedEventHandler.cs
- ServerValidateEventArgs.cs
- ScrollViewerAutomationPeer.cs
- DataKey.cs
- WindowsSolidBrush.cs
- DataTableNewRowEvent.cs
- ServiceDebugBehavior.cs
- ToolboxItemAttribute.cs
- ParsedAttributeCollection.cs
- VisualTreeUtils.cs
- MediaElement.cs
- StringWriter.cs
- SoapSchemaImporter.cs
- SchemaAttDef.cs
- ObjectDataSourceDisposingEventArgs.cs
- SectionVisual.cs
- UIElement3DAutomationPeer.cs
- PolicyChain.cs
- SharedPersonalizationStateInfo.cs
- InstanceHandle.cs
- HeaderCollection.cs
- TextTreeDeleteContentUndoUnit.cs
- FtpWebRequest.cs
- Graphics.cs
- PerformanceCounterPermissionEntry.cs
- MobileControlsSection.cs
- PreProcessInputEventArgs.cs
- SchemaCollectionCompiler.cs
- HighlightComponent.cs
- VScrollProperties.cs
- BoundColumn.cs
- RC2CryptoServiceProvider.cs
- BrowserCapabilitiesFactory35.cs
- IncrementalCompileAnalyzer.cs
- PrintDialogException.cs
- SourceLocationProvider.cs
- SetterBaseCollection.cs
- WCFModelStrings.Designer.cs
- JoinCqlBlock.cs
- FastPropertyAccessor.cs
- WindowsAltTab.cs
- Exceptions.cs
- CalendarDayButton.cs
- HttpResponseHeader.cs
- ClientSettingsStore.cs
- LOSFormatter.cs
- Rijndael.cs
- PrimitiveCodeDomSerializer.cs
- BatchServiceHost.cs
- XPathPatternParser.cs
- ToolStripSeparator.cs
- PriorityBinding.cs
- SessionPageStateSection.cs
- PageThemeCodeDomTreeGenerator.cs
- Color.cs
- EntityClassGenerator.cs
- ProjectionPathBuilder.cs
- ProcessHostFactoryHelper.cs
- TypeDescriptionProviderAttribute.cs
- SiteMapPath.cs
- Socket.cs
- CompositeFontFamily.cs
- FileDialogPermission.cs
- OperationCanceledException.cs
- BaseValidatorDesigner.cs
- TabPanel.cs