Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- HttpHandler.cs
- ModelVisual3D.cs
- XmlObjectSerializerWriteContextComplex.cs
- DataGridCellEditEndingEventArgs.cs
- ColumnReorderedEventArgs.cs
- NativeMethods.cs
- CapabilitiesAssignment.cs
- _SafeNetHandles.cs
- ValidatingReaderNodeData.cs
- EventsTab.cs
- ReferenceService.cs
- ServiceObjectContainer.cs
- DefaultPropertyAttribute.cs
- PeerInvitationResponse.cs
- SingleObjectCollection.cs
- PageThemeBuildProvider.cs
- SRDisplayNameAttribute.cs
- Timer.cs
- StylusEditingBehavior.cs
- ICspAsymmetricAlgorithm.cs
- EdmItemError.cs
- CroppedBitmap.cs
- CellLabel.cs
- RadioButtonFlatAdapter.cs
- TextElementEnumerator.cs
- Oid.cs
- HttpSocketManager.cs
- DataControlLinkButton.cs
- AvTraceFormat.cs
- SuppressMergeCheckAttribute.cs
- SplitContainer.cs
- ServicePointManagerElement.cs
- RuntimeConfigLKG.cs
- CodeSpit.cs
- CommandBinding.cs
- JsonReaderDelegator.cs
- EndpointDiscoveryMetadataCD1.cs
- xmlglyphRunInfo.cs
- ViewLoader.cs
- SafeRightsManagementSessionHandle.cs
- XmlILStorageConverter.cs
- AsyncWaitHandle.cs
- TextSimpleMarkerProperties.cs
- XmlSerializationWriter.cs
- _SafeNetHandles.cs
- RealProxy.cs
- Geometry3D.cs
- StyleCollectionEditor.cs
- ListBoxItemWrapperAutomationPeer.cs
- NetworkInformationException.cs
- ObjectKeyFrameCollection.cs
- XmlSchemaAnnotated.cs
- PageCatalogPart.cs
- SafeCryptoHandles.cs
- httpserverutility.cs
- WorkflowValidationFailedException.cs
- SymbolTable.cs
- ConfigXmlText.cs
- DetailsViewModeEventArgs.cs
- XmlSchemaSimpleTypeRestriction.cs
- MasterPage.cs
- AssemblyResolver.cs
- DiscriminatorMap.cs
- ProxyWebPartManager.cs
- TabPanel.cs
- ZipIORawDataFileBlock.cs
- MessageSmuggler.cs
- BatchStream.cs
- DataBinder.cs
- CreationContext.cs
- NamespaceCollection.cs
- XsdDuration.cs
- HtmlInputButton.cs
- NetworkInterface.cs
- TraceContextRecord.cs
- DataGridViewRowPostPaintEventArgs.cs
- BasicExpandProvider.cs
- Wizard.cs
- DispatcherHooks.cs
- FlowLayout.cs
- ResourceDisplayNameAttribute.cs
- Condition.cs
- Tablet.cs
- ToolTip.cs
- RoleBoolean.cs
- CodeStatement.cs
- WebExceptionStatus.cs
- DataGridViewUtilities.cs
- Thread.cs
- DesignerVerbToolStripMenuItem.cs
- GPRECTF.cs
- ComponentGlyph.cs
- Selector.cs
- ScriptingProfileServiceSection.cs
- regiisutil.cs
- Rotation3DKeyFrameCollection.cs
- Evidence.cs
- QuaternionRotation3D.cs
- PeerPresenceInfo.cs
- DbDeleteCommandTree.cs