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 / ObjectToken / VoiceObjectToken.cs / 1 / VoiceObjectToken.cs
//----------------------------------------------------------------------------
//
//
// Copyright (C) Microsoft Corporation. All rights reserved.
//
//
//
// Description:
// Encapsulation for an Object Token of type voice
//
// History:
// 7/1/2004 jeanfp
//---------------------------------------------------------------------------
using Microsoft.Win32;
using System;
using System.Diagnostics;
using RegistryEntry = System.Collections.Generic.KeyValuePair;
namespace System.Speech.Internal.ObjectTokens
{
///
/// Summary description for VoiceObjectToken.
///
#if VSCOMPILE
[DebuggerDisplay ("{Name}")]
#endif
internal class VoiceObjectToken : ObjectToken
{
//*******************************************************************
//
// Constructors
//
//*******************************************************************
#region Constructors
protected VoiceObjectToken (string keyId, RegistryKey hkey)
: base (keyId, hkey)
{
}
static internal VoiceObjectToken Create (string sCategoryId, string sTokenId)
{
string id;
RegistryKey hkey = ObjectToken.CreateKey (sCategoryId, sTokenId, false, out id);
if (hkey != null)
{
return new VoiceObjectToken (id, hkey);
}
return null;
}
#endregion
//********************************************************************
//
// Public Methods
//
//*******************************************************************
#region Public Methods
/// TODOC
public override bool Equals (object obj)
{
VoiceObjectToken refObj = obj as VoiceObjectToken;
if (refObj == null)
{
return false;
}
return Id == refObj.Id;
}
/// TODOC
public override int GetHashCode ()
{
return Id.GetHashCode ();
}
#endregion
//********************************************************************
//
// Internal Properties
//
//********************************************************************
#region Internal Properties
///
/// Returns the Age from a voice token
///
///
internal string Age
{
get
{
string age;
if (Attributes == null || !Attributes.TryGetString ("Age", out age))
{
age = string.Empty;
}
return age;
}
}
///
/// Returns the gender
///
///
internal string Gender
{
get
{
string gender;
if (Attributes == null || !Attributes.TryGetString ("Gender", out gender))
{
gender = string.Empty;
}
return gender;
}
}
#if SPEECHSERVER
internal VoiceCategory VoiceCategory
{
set
{
_category = value;
}
get
{
return _category;
}
}
#endif
#endregion
//*******************************************************************
//
// Protected Methods
//
//********************************************************************
#region Protected Methods
protected override void Dispose (bool disposing)
{
base.Dispose (disposing);
}
#endregion
//*******************************************************************
//
// Private Fields
//
//*******************************************************************
#region Private Fields
#if SPEECHSERVER
private VoiceCategory _category = VoiceCategory.Default;
#endif
#endregion
}
//*******************************************************************
//
// Private Types
//
//********************************************************************
#region Private Types
#if SPEECHSERVER
internal enum VoiceCategory
{
Default,
ScanSoft
}
#endif
#endregion
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
//----------------------------------------------------------------------------
//
//
// Copyright (C) Microsoft Corporation. All rights reserved.
//
//
//
// Description:
// Encapsulation for an Object Token of type voice
//
// History:
// 7/1/2004 jeanfp
//---------------------------------------------------------------------------
using Microsoft.Win32;
using System;
using System.Diagnostics;
using RegistryEntry = System.Collections.Generic.KeyValuePair;
namespace System.Speech.Internal.ObjectTokens
{
///
/// Summary description for VoiceObjectToken.
///
#if VSCOMPILE
[DebuggerDisplay ("{Name}")]
#endif
internal class VoiceObjectToken : ObjectToken
{
//*******************************************************************
//
// Constructors
//
//*******************************************************************
#region Constructors
protected VoiceObjectToken (string keyId, RegistryKey hkey)
: base (keyId, hkey)
{
}
static internal VoiceObjectToken Create (string sCategoryId, string sTokenId)
{
string id;
RegistryKey hkey = ObjectToken.CreateKey (sCategoryId, sTokenId, false, out id);
if (hkey != null)
{
return new VoiceObjectToken (id, hkey);
}
return null;
}
#endregion
//********************************************************************
//
// Public Methods
//
//*******************************************************************
#region Public Methods
/// TODOC
public override bool Equals (object obj)
{
VoiceObjectToken refObj = obj as VoiceObjectToken;
if (refObj == null)
{
return false;
}
return Id == refObj.Id;
}
/// TODOC
public override int GetHashCode ()
{
return Id.GetHashCode ();
}
#endregion
//********************************************************************
//
// Internal Properties
//
//********************************************************************
#region Internal Properties
///
/// Returns the Age from a voice token
///
///
internal string Age
{
get
{
string age;
if (Attributes == null || !Attributes.TryGetString ("Age", out age))
{
age = string.Empty;
}
return age;
}
}
///
/// Returns the gender
///
///
internal string Gender
{
get
{
string gender;
if (Attributes == null || !Attributes.TryGetString ("Gender", out gender))
{
gender = string.Empty;
}
return gender;
}
}
#if SPEECHSERVER
internal VoiceCategory VoiceCategory
{
set
{
_category = value;
}
get
{
return _category;
}
}
#endif
#endregion
//*******************************************************************
//
// Protected Methods
//
//********************************************************************
#region Protected Methods
protected override void Dispose (bool disposing)
{
base.Dispose (disposing);
}
#endregion
//*******************************************************************
//
// Private Fields
//
//*******************************************************************
#region Private Fields
#if SPEECHSERVER
private VoiceCategory _category = VoiceCategory.Default;
#endif
#endregion
}
//*******************************************************************
//
// Private Types
//
//********************************************************************
#region Private Types
#if SPEECHSERVER
internal enum VoiceCategory
{
Default,
ScanSoft
}
#endif
#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
- serverconfig.cs
- AnimationException.cs
- _ProxyRegBlob.cs
- InplaceBitmapMetadataWriter.cs
- Point4D.cs
- XPathSingletonIterator.cs
- DataRelationPropertyDescriptor.cs
- XmlDocumentType.cs
- TextDecorationLocationValidation.cs
- DataGridToolTip.cs
- ContextBase.cs
- SubMenuStyleCollection.cs
- DrawingImage.cs
- ZipIOLocalFileBlock.cs
- HelpEvent.cs
- ContextMarshalException.cs
- SqlCommand.cs
- LabelEditEvent.cs
- BulletedListDesigner.cs
- EntityStoreSchemaFilterEntry.cs
- MatrixCamera.cs
- CopyNamespacesAction.cs
- Base64WriteStateInfo.cs
- CornerRadiusConverter.cs
- Part.cs
- FontFamily.cs
- ComplexBindingPropertiesAttribute.cs
- GiveFeedbackEventArgs.cs
- SoapWriter.cs
- Nodes.cs
- TcpConnectionPoolSettingsElement.cs
- CalendarDesigner.cs
- ConversionValidationRule.cs
- OracleSqlParser.cs
- DbDataReader.cs
- PauseStoryboard.cs
- EvidenceBase.cs
- ConnectionPointCookie.cs
- ProfileModule.cs
- XmlValueConverter.cs
- DeploymentExceptionMapper.cs
- BaseTemplateBuildProvider.cs
- InstanceData.cs
- BoolExpr.cs
- TableHeaderCell.cs
- ReferentialConstraint.cs
- AffineTransform3D.cs
- CacheHelper.cs
- SHA384.cs
- HtmlInputSubmit.cs
- DecoderExceptionFallback.cs
- ProtectedConfiguration.cs
- ContentFilePart.cs
- PowerStatus.cs
- StyleXamlParser.cs
- HelpInfo.cs
- DataGridViewAddColumnDialog.cs
- DrawingState.cs
- ListViewAutomationPeer.cs
- MailHeaderInfo.cs
- X509CertificateValidator.cs
- messageonlyhwndwrapper.cs
- PartitionResolver.cs
- SchemaTypeEmitter.cs
- SQLDouble.cs
- DeobfuscatingStream.cs
- TypefaceMetricsCache.cs
- UpdateTracker.cs
- TextOptions.cs
- CodeObject.cs
- FunctionQuery.cs
- ThemeInfoAttribute.cs
- _AcceptOverlappedAsyncResult.cs
- WebBrowserUriTypeConverter.cs
- NativeCompoundFileAPIs.cs
- Brushes.cs
- WebPartEventArgs.cs
- JournalNavigationScope.cs
- PopupRootAutomationPeer.cs
- ValidationRuleCollection.cs
- BooleanAnimationUsingKeyFrames.cs
- Overlapped.cs
- OracleBinary.cs
- ProfileEventArgs.cs
- DrawingAttributes.cs
- ResourceAttributes.cs
- XmlSchemaException.cs
- EntitySet.cs
- DataServiceQueryException.cs
- TemplatedAdorner.cs
- SqlClientPermission.cs
- _DomainName.cs
- MenuItemCollection.cs
- ScaleTransform3D.cs
- SystemFonts.cs
- DropDownButton.cs
- InputProcessorProfilesLoader.cs
- SelfSignedCertificate.cs
- InstanceCollisionException.cs
- XmlMessageFormatter.cs