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
- EntitySqlQueryBuilder.cs
- UniqueConstraint.cs
- FtpWebRequest.cs
- FilteredDataSetHelper.cs
- AssociationSetEnd.cs
- PropertyTab.cs
- CompositeScriptReferenceEventArgs.cs
- EndpointAddress10.cs
- DataGridViewColumnCollectionDialog.cs
- TransactionCache.cs
- ResourceLoader.cs
- UnmanagedBitmapWrapper.cs
- HtmlInputImage.cs
- MessageDecoder.cs
- designeractionlistschangedeventargs.cs
- ReadOnlyMetadataCollection.cs
- EdmProviderManifest.cs
- Expr.cs
- EventLogEntry.cs
- ZeroOpNode.cs
- sitestring.cs
- XmlChildNodes.cs
- ScriptResourceDefinition.cs
- InputProcessorProfilesLoader.cs
- XsltQilFactory.cs
- OptimalBreakSession.cs
- ExpressionVisitorHelpers.cs
- EntitySetDataBindingList.cs
- ListViewGroup.cs
- RecognizedWordUnit.cs
- TimeSpanStorage.cs
- WSSecurityOneDotZeroReceiveSecurityHeader.cs
- TextMetrics.cs
- RenderData.cs
- ModelUtilities.cs
- TypeInitializationException.cs
- Parser.cs
- TextServicesPropertyRanges.cs
- RuleInfoComparer.cs
- Timer.cs
- DataServiceHostFactory.cs
- PriorityItem.cs
- HtmlHead.cs
- SqlWriter.cs
- HttpSessionStateBase.cs
- ResourceContainerWrapper.cs
- AsymmetricSignatureFormatter.cs
- SeparatorAutomationPeer.cs
- DataGridTable.cs
- CompilationUnit.cs
- SrgsGrammarCompiler.cs
- ArgumentReference.cs
- MasterPageCodeDomTreeGenerator.cs
- TemplateManager.cs
- LinkButton.cs
- Point3DAnimationUsingKeyFrames.cs
- SafeEventLogWriteHandle.cs
- EnumerableRowCollectionExtensions.cs
- SchemaImporterExtensionElement.cs
- HttpListenerPrefixCollection.cs
- HMAC.cs
- HelpKeywordAttribute.cs
- Context.cs
- HttpListenerContext.cs
- MergablePropertyAttribute.cs
- FormClosedEvent.cs
- WebPartCancelEventArgs.cs
- ContainsSearchOperator.cs
- AssemblyBuilder.cs
- ParallelForEach.cs
- HtmlLink.cs
- BCryptNative.cs
- DrawItemEvent.cs
- TimeSpanMinutesConverter.cs
- PackageRelationship.cs
- SignatureToken.cs
- InputElement.cs
- XmlIgnoreAttribute.cs
- IISUnsafeMethods.cs
- StorageEntitySetMapping.cs
- ReflectionUtil.cs
- HttpListenerException.cs
- WindowsIdentity.cs
- DownloadProgressEventArgs.cs
- HashCodeCombiner.cs
- PermissionSetEnumerator.cs
- XmlExceptionHelper.cs
- ContainerParagraph.cs
- PolicyChain.cs
- ManifestResourceInfo.cs
- WebPart.cs
- ProfessionalColorTable.cs
- ObjectIDGenerator.cs
- DiagnosticTraceSource.cs
- ACE.cs
- CompositeKey.cs
- CapiHashAlgorithm.cs
- Camera.cs
- SrgsNameValueTag.cs
- TreeView.cs