Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / Configuration / System / Configuration / ProtectedConfiguration.cs / 1 / ProtectedConfiguration.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Configuration { using System.Collections; using System.Collections.Specialized; using System.Runtime.Serialization; using System.Configuration.Provider; using System.Xml; using System.Security.Permissions; [PermissionSet(SecurityAction.LinkDemand, Name = "FullTrust")] public static class ProtectedConfiguration { public static ProtectedConfigurationProviderCollection Providers { get { ProtectedConfigurationSection config = PrivilegedConfigurationManager.GetSection(BaseConfigurationRecord.RESERVED_SECTION_PROTECTED_CONFIGURATION) as ProtectedConfigurationSection; if (config == null) return new ProtectedConfigurationProviderCollection(); return config.GetAllProviders(); } } public const string RsaProviderName = "RsaProtectedConfigurationProvider"; public const string DataProtectionProviderName = "DataProtectionConfigurationProvider"; public const string ProtectedDataSectionName = BaseConfigurationRecord.RESERVED_SECTION_PROTECTED_CONFIGURATION; public static string DefaultProvider { get { ProtectedConfigurationSection config = PrivilegedConfigurationManager.GetSection(BaseConfigurationRecord.RESERVED_SECTION_PROTECTED_CONFIGURATION) as ProtectedConfigurationSection; if (config != null) return config.DefaultProvider; return ""; } } /////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// #if CACHE_PROVIDERS_IN_STATIC private static void InstantiateProviders() { if (_Providers != null) return; lock (_Lock) { if (_Providers != null) return; ProtectedConfigurationProviderCollection providers = new ProtectedConfigurationProviderCollection(); ProtectedConfigurationSection config = PrivilegedConfigurationManager.GetSection(BaseConfigurationRecord.RESERVED_SECTION_PROTECTED_CONFIGURATION) as ProtectedConfigurationSection; if (config != null) { foreach (DictionaryEntry de in config.ProviderNodes) { ProviderNode pn = de.Value as ProviderNode; if (pn == null) continue; providers.Add(pn.Provider); } } _Providers = providers; } } private static object _Lock = new object(); private static ProtectedConfigurationProviderCollection _Providers = null; #endif } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Configuration { using System.Collections; using System.Collections.Specialized; using System.Runtime.Serialization; using System.Configuration.Provider; using System.Xml; using System.Security.Permissions; [PermissionSet(SecurityAction.LinkDemand, Name = "FullTrust")] public static class ProtectedConfiguration { public static ProtectedConfigurationProviderCollection Providers { get { ProtectedConfigurationSection config = PrivilegedConfigurationManager.GetSection(BaseConfigurationRecord.RESERVED_SECTION_PROTECTED_CONFIGURATION) as ProtectedConfigurationSection; if (config == null) return new ProtectedConfigurationProviderCollection(); return config.GetAllProviders(); } } public const string RsaProviderName = "RsaProtectedConfigurationProvider"; public const string DataProtectionProviderName = "DataProtectionConfigurationProvider"; public const string ProtectedDataSectionName = BaseConfigurationRecord.RESERVED_SECTION_PROTECTED_CONFIGURATION; public static string DefaultProvider { get { ProtectedConfigurationSection config = PrivilegedConfigurationManager.GetSection(BaseConfigurationRecord.RESERVED_SECTION_PROTECTED_CONFIGURATION) as ProtectedConfigurationSection; if (config != null) return config.DefaultProvider; return ""; } } /////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// #if CACHE_PROVIDERS_IN_STATIC private static void InstantiateProviders() { if (_Providers != null) return; lock (_Lock) { if (_Providers != null) return; ProtectedConfigurationProviderCollection providers = new ProtectedConfigurationProviderCollection(); ProtectedConfigurationSection config = PrivilegedConfigurationManager.GetSection(BaseConfigurationRecord.RESERVED_SECTION_PROTECTED_CONFIGURATION) as ProtectedConfigurationSection; if (config != null) { foreach (DictionaryEntry de in config.ProviderNodes) { ProviderNode pn = de.Value as ProviderNode; if (pn == null) continue; providers.Add(pn.Provider); } } _Providers = providers; } } private static object _Lock = new object(); private static ProtectedConfigurationProviderCollection _Providers = null; #endif } } // 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
- GridViewColumnCollectionChangedEventArgs.cs
- DataGridCommandEventArgs.cs
- PropertyCondition.cs
- DependencyObject.cs
- MetadataLocation.cs
- PropertyMappingExceptionEventArgs.cs
- Duration.cs
- IconConverter.cs
- Walker.cs
- FreezableDefaultValueFactory.cs
- XmlSchemaElement.cs
- Int32RectValueSerializer.cs
- TransformGroup.cs
- Funcletizer.cs
- CatalogZone.cs
- WaitHandleCannotBeOpenedException.cs
- ListChangedEventArgs.cs
- EntityDataSourceEntitySetNameItem.cs
- SpellerError.cs
- ConnectionProviderAttribute.cs
- ListBindingConverter.cs
- FormViewModeEventArgs.cs
- ConfigurationSectionHelper.cs
- HttpCacheVaryByContentEncodings.cs
- SqlProfileProvider.cs
- SubstitutionList.cs
- ChangePasswordAutoFormat.cs
- StackBuilderSink.cs
- TableCell.cs
- Cursor.cs
- ContractComponent.cs
- FailedToStartupUIException.cs
- _StreamFramer.cs
- NeutralResourcesLanguageAttribute.cs
- AutomationPattern.cs
- ImageSourceConverter.cs
- WindowsStartMenu.cs
- SafeFileHandle.cs
- ArrayExtension.cs
- DecimalAnimation.cs
- XmlMtomWriter.cs
- PropertyTab.cs
- OperatingSystem.cs
- WebMessageBodyStyleHelper.cs
- FormatException.cs
- DataGridPreparingCellForEditEventArgs.cs
- ScriptControlDescriptor.cs
- FormatConvertedBitmap.cs
- MessageEnumerator.cs
- SystemIcmpV4Statistics.cs
- MsmqInputSessionChannelListener.cs
- Permission.cs
- BlurEffect.cs
- nulltextnavigator.cs
- GcSettings.cs
- ReferencedType.cs
- AdornerLayer.cs
- SrgsToken.cs
- StateRuntime.cs
- QueryAsyncResult.cs
- OdbcCommandBuilder.cs
- UInt32Storage.cs
- ConfigXmlDocument.cs
- FrugalList.cs
- ErrorLog.cs
- OwnerDrawPropertyBag.cs
- ContentPresenter.cs
- Timer.cs
- PropertyInfoSet.cs
- LayoutInformation.cs
- updateconfighost.cs
- CommonEndpointBehaviorElement.cs
- ApplicationFileCodeDomTreeGenerator.cs
- COSERVERINFO.cs
- RemoteWebConfigurationHostStream.cs
- OleDbReferenceCollection.cs
- WrappingXamlSchemaContext.cs
- ChangeConflicts.cs
- TargetException.cs
- HostingEnvironment.cs
- FormViewInsertedEventArgs.cs
- LinkLabelLinkClickedEvent.cs
- DispatcherOperation.cs
- WSHttpBinding.cs
- MobileControlsSectionHandler.cs
- ContentType.cs
- webeventbuffer.cs
- TableCellCollection.cs
- CrossContextChannel.cs
- LoadedOrUnloadedOperation.cs
- HandlerFactoryCache.cs
- AutomationIdentifierGuids.cs
- _LocalDataStore.cs
- XmlQueryRuntime.cs
- ActivationArguments.cs
- XmlSchemaInferenceException.cs
- path.cs
- SafeNativeHandle.cs
- TransformedBitmap.cs
- ContentPlaceHolderDesigner.cs