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
- TextElementEditingBehaviorAttribute.cs
- DeferredElementTreeState.cs
- SqlTriggerContext.cs
- AttachedProperty.cs
- ScrollChangedEventArgs.cs
- SqlUdtInfo.cs
- X509SecurityTokenAuthenticator.cs
- EntityViewGenerator.cs
- ConnectorEditor.cs
- DataGridComboBoxColumn.cs
- WindowInteractionStateTracker.cs
- CopyNamespacesAction.cs
- FileChangeNotifier.cs
- DebuggerAttributes.cs
- EncoderReplacementFallback.cs
- RelationshipEndMember.cs
- GeneralTransform3DTo2DTo3D.cs
- remotingproxy.cs
- ImportedNamespaceContextItem.cs
- QueryContinueDragEventArgs.cs
- NetworkInterface.cs
- ComponentEditorForm.cs
- UnsafeNativeMethodsPenimc.cs
- ZipIOLocalFileBlock.cs
- RoleExceptions.cs
- DataGridCellsPresenter.cs
- PersonalizationProvider.cs
- WindowsAuthenticationEventArgs.cs
- Convert.cs
- ObfuscationAttribute.cs
- IdentitySection.cs
- PropertyEmitterBase.cs
- StyleXamlParser.cs
- StreamReader.cs
- ApplicationSecurityInfo.cs
- QueryAccessibilityHelpEvent.cs
- ControlBuilderAttribute.cs
- AsyncCodeActivityContext.cs
- TlsSspiNegotiation.cs
- UIElement3D.cs
- NativeMethods.cs
- BamlBinaryWriter.cs
- Environment.cs
- HttpListener.cs
- StickyNoteHelper.cs
- SqlConnectionPoolGroupProviderInfo.cs
- X509Certificate2.cs
- RequestQueue.cs
- ProviderMetadataCachedInformation.cs
- XsdDuration.cs
- _OverlappedAsyncResult.cs
- ContentPresenter.cs
- StringInfo.cs
- HMACMD5.cs
- EllipseGeometry.cs
- CustomErrorsSection.cs
- ListCollectionView.cs
- UrlMappingCollection.cs
- RawAppCommandInputReport.cs
- AutoCompleteStringCollection.cs
- CodeConstructor.cs
- CodeNamespaceCollection.cs
- DesignerSerializationManager.cs
- Style.cs
- FileRecordSequence.cs
- BufferBuilder.cs
- GPPOINTF.cs
- BitmapCodecInfoInternal.cs
- CacheEntry.cs
- Char.cs
- MaskedTextBox.cs
- WebContext.cs
- followingquery.cs
- ViewStateChangedEventArgs.cs
- WindowsTokenRoleProvider.cs
- ConnectionsZone.cs
- EditingScope.cs
- ProvideValueServiceProvider.cs
- PropertyChangeTracker.cs
- FilterQueryOptionExpression.cs
- AppSettingsReader.cs
- CapabilitiesAssignment.cs
- CodeExpressionCollection.cs
- UnauthorizedAccessException.cs
- AspProxy.cs
- SqlDependencyUtils.cs
- DbProviderFactory.cs
- AssemblyInfo.cs
- RemotingAttributes.cs
- AnnotationService.cs
- TypeForwardedToAttribute.cs
- ViewLoader.cs
- ToolboxControl.cs
- DocComment.cs
- ProgressBarHighlightConverter.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- _NTAuthentication.cs
- CorrelationManager.cs
- ScrollChrome.cs
- SystemWebExtensionsSectionGroup.cs