Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Speech / Src / Internal / ObjectToken / ObjectTokenCategory.cs / 1 / ObjectTokenCategory.cs
//---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // // Description: // Object Token Category // // History: // 7/1/2004 [....] //--------------------------------------------------------------------------- using Microsoft.Win32; using System; using System.Collections; using System.Collections.Generic; using System.Globalization; namespace System.Speech.Internal.ObjectTokens { ////// Summary description for ObjectTokenCategory. /// internal class ObjectTokenCategory : RegistryDataKey, IEnumerable{ //******************************************************************* // // Constructors // //******************************************************************* #region Constructors protected ObjectTokenCategory (string keyId, RegistryKey hkey) : base (keyId, hkey) { } static internal ObjectTokenCategory Create (string sCategoryId) { string id; RegistryKey hkey = ObjectToken.CreateKey (sCategoryId, false, out id); if (hkey != null) { return new ObjectTokenCategory (id, hkey); } return null; } #endregion //******************************************************************** // // Internal Methods // //******************************************************************* #region internal Methods internal ObjectToken OpenToken (string keyName) { // Check if the token is for a voice string tokenName = keyName; if (!string.IsNullOrEmpty (tokenName) && tokenName.IndexOf ("HKEY_", StringComparison.Ordinal) != 0) { tokenName = string.Format (CultureInfo.InvariantCulture, @"{0}\Tokens\{1}", Id, tokenName); } bool fVoiceToken = !string.IsNullOrEmpty (tokenName) && tokenName.IndexOf (@"Voices\Tokens", StringComparison.Ordinal) > 0; return fVoiceToken ? VoiceObjectToken.Create (null, tokenName) : ObjectToken.Create (null, tokenName, false); } #if false internal ObjectToken CreateToken (string keyName) { return new ObjectToken (Id, @"Token\" + keyName, true); } internal void DeleteToken (string keyName) { DeleteKey (@"Token\" + keyName); } #endif #region IEnumerable implementation IEnumerator IEnumerable .GetEnumerator () { RegistryDataKey token; if (TryOpenKey ("Tokens", out token)) { foreach (RegistryDataKey key in token) { string id = key.Id; yield return OpenToken (key.Id); key.Dispose (); } token.Dispose (); } } IEnumerator IEnumerable.GetEnumerator () { return ((IEnumerable ) this).GetEnumerator (); } #endregion #endregion //******************************************************************** // // Protected Methods // //******************************************************************** #region Protected Methods protected override void Dispose (bool disposing) { base.Dispose (disposing); } #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
- _SslStream.cs
- AnonymousIdentificationModule.cs
- MenuItem.cs
- DialogResultConverter.cs
- UserControl.cs
- DataFormat.cs
- DataGridViewRowPrePaintEventArgs.cs
- Process.cs
- AttributedMetaModel.cs
- PolygonHotSpot.cs
- TCPListener.cs
- PrivilegeNotHeldException.cs
- ApplyHostConfigurationBehavior.cs
- ColorConvertedBitmap.cs
- CacheEntry.cs
- XmlArrayAttribute.cs
- BCryptSafeHandles.cs
- PnrpPeerResolver.cs
- ScriptBehaviorDescriptor.cs
- FontStyles.cs
- DBBindings.cs
- ContentType.cs
- RadioButton.cs
- ConfigXmlWhitespace.cs
- XmlMessageFormatter.cs
- FontCacheLogic.cs
- PartialTrustVisibleAssemblyCollection.cs
- SHA1Cng.cs
- UniqueIdentifierService.cs
- graph.cs
- ServerIdentity.cs
- SimplePropertyEntry.cs
- ComponentCollection.cs
- DataGridDefaultColumnWidthTypeConverter.cs
- ModelPropertyDescriptor.cs
- XmlSchemaAttributeGroupRef.cs
- ZoneLinkButton.cs
- IgnorePropertiesAttribute.cs
- COM2PropertyDescriptor.cs
- DataFieldEditor.cs
- XmlSiteMapProvider.cs
- CryptoStream.cs
- Operators.cs
- ContextProperty.cs
- SyndicationFeedFormatter.cs
- ClientScriptManager.cs
- LinkedResourceCollection.cs
- Common.cs
- IndexerNameAttribute.cs
- TemplateField.cs
- NativeMethods.cs
- LineServices.cs
- ThicknessAnimationUsingKeyFrames.cs
- ValueTable.cs
- BoolExpression.cs
- GatewayIPAddressInformationCollection.cs
- ConcurrencyBehavior.cs
- SrgsGrammar.cs
- WebPartDisplayModeCollection.cs
- Drawing.cs
- SecurityHelper.cs
- WebPermission.cs
- SystemWebCachingSectionGroup.cs
- HashSetEqualityComparer.cs
- DataGridViewDataConnection.cs
- SystemNetHelpers.cs
- ObjectListCommandEventArgs.cs
- SemaphoreFullException.cs
- HealthMonitoringSection.cs
- DrawListViewSubItemEventArgs.cs
- NullReferenceException.cs
- XmlNodeReader.cs
- NamedPipeAppDomainProtocolHandler.cs
- TreeIterators.cs
- XsdBuildProvider.cs
- CalendarDataBindingHandler.cs
- FormViewModeEventArgs.cs
- QualificationDataItem.cs
- SyntaxCheck.cs
- _UncName.cs
- ExpressionList.cs
- controlskin.cs
- SafeHandle.cs
- FileCodeGroup.cs
- LinqDataSourceStatusEventArgs.cs
- DecimalStorage.cs
- HttpAsyncResult.cs
- PageRanges.cs
- elementinformation.cs
- _BasicClient.cs
- DataBinding.cs
- CategoryNameCollection.cs
- BitmapEffectrendercontext.cs
- SHA1.cs
- LicenseException.cs
- formatter.cs
- WriteTimeStream.cs
- EncoderFallback.cs
- ComponentDispatcherThread.cs
- CodeAttributeDeclaration.cs