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
- CodeExporter.cs
- EventProxy.cs
- ConfigsHelper.cs
- HttpRequestCacheValidator.cs
- TemplatedEditableDesignerRegion.cs
- ToolboxComponentsCreatedEventArgs.cs
- TaiwanLunisolarCalendar.cs
- JsonClassDataContract.cs
- CompoundFileReference.cs
- NullableBoolConverter.cs
- GridItemPattern.cs
- ConfigurationSettings.cs
- PassportAuthenticationEventArgs.cs
- DataListItemCollection.cs
- PageAsyncTaskManager.cs
- Equal.cs
- GridViewRowPresenter.cs
- UnmanagedMarshal.cs
- CodeEntryPointMethod.cs
- MimeMultiPart.cs
- MimeMapping.cs
- DataSourceSelectArguments.cs
- DATA_BLOB.cs
- KeyConverter.cs
- InvokeSchedule.cs
- ComAdminInterfaces.cs
- Base64Decoder.cs
- SecureEnvironment.cs
- DefaultBinder.cs
- ForeignKeyConstraint.cs
- TranslateTransform3D.cs
- Adorner.cs
- PrimitiveType.cs
- DefaultProxySection.cs
- XmlExtensionFunction.cs
- SafeEventHandle.cs
- Int64Storage.cs
- ViewBase.cs
- SinglePageViewer.cs
- ControllableStoryboardAction.cs
- SQLUtility.cs
- EntityContainerAssociationSet.cs
- ACL.cs
- CloseCryptoHandleRequest.cs
- EUCJPEncoding.cs
- GeometryDrawing.cs
- EntityDescriptor.cs
- XPathExpr.cs
- PointIndependentAnimationStorage.cs
- ImageListUtils.cs
- AdapterDictionary.cs
- HandlerWithFactory.cs
- DateTimeEditor.cs
- InputLanguageCollection.cs
- PrintDialogException.cs
- ScaleTransform3D.cs
- Vector.cs
- InputLanguageCollection.cs
- DisplayMemberTemplateSelector.cs
- UnsafeNativeMethodsCLR.cs
- XslCompiledTransform.cs
- EdmToObjectNamespaceMap.cs
- SiteIdentityPermission.cs
- ThemeDictionaryExtension.cs
- TypeDescriptor.cs
- ExpressionEditor.cs
- CodeValidator.cs
- TextHidden.cs
- ClaimTypeElementCollection.cs
- HandleRef.cs
- securitycriticaldata.cs
- EntityCollection.cs
- WebPartCollection.cs
- mediapermission.cs
- StructuredType.cs
- TargetControlTypeCache.cs
- TextTreeUndo.cs
- CodeIndexerExpression.cs
- NamespaceEmitter.cs
- CatalogPartChrome.cs
- HttpRequestCacheValidator.cs
- sapiproxy.cs
- DataBinding.cs
- EventLogPermissionAttribute.cs
- ArraySet.cs
- ViewStateException.cs
- SafeNativeHandle.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- PagedDataSource.cs
- DataRelationPropertyDescriptor.cs
- KnownTypesHelper.cs
- PathFigureCollection.cs
- CodeCompiler.cs
- Convert.cs
- IdnElement.cs
- RuleInfoComparer.cs
- Pair.cs
- KeyNotFoundException.cs
- AutomationEvent.cs
- DeferredReference.cs