Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Configuration / System / Configuration / ProtectedConfiguration.cs / 1305376 / 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
- DataGridViewCellConverter.cs
- ClrPerspective.cs
- IncomingWebRequestContext.cs
- DesignerExtenders.cs
- DataGridViewImageColumn.cs
- CrossContextChannel.cs
- CheckoutException.cs
- IndicCharClassifier.cs
- ListBindingHelper.cs
- LinkLabelLinkClickedEvent.cs
- DummyDataSource.cs
- AsyncSerializedWorker.cs
- Assert.cs
- SafeMILHandle.cs
- CachedBitmap.cs
- Point3DCollectionConverter.cs
- ObjectConverter.cs
- MDIClient.cs
- ForEachAction.cs
- MexHttpBindingElement.cs
- NamespaceDecl.cs
- RenderCapability.cs
- CommonGetThemePartSize.cs
- HostVisual.cs
- ProtocolsConfigurationEntry.cs
- DesignerRegionMouseEventArgs.cs
- FrameworkPropertyMetadata.cs
- ChangePasswordAutoFormat.cs
- NumericExpr.cs
- IPAddressCollection.cs
- TextParagraphProperties.cs
- PeerTransportSecuritySettings.cs
- _HTTPDateParse.cs
- Math.cs
- WebPartConnectionCollection.cs
- BitmapEffectDrawingContent.cs
- Menu.cs
- ValidateNames.cs
- _SSPISessionCache.cs
- HtmlForm.cs
- NumericUpDownAccelerationCollection.cs
- RegistryDataKey.cs
- SmiEventSink_Default.cs
- SqlExpander.cs
- UpDownBase.cs
- ViewgenContext.cs
- ControlUtil.cs
- Span.cs
- SolidBrush.cs
- DbDataRecord.cs
- RelativeSource.cs
- ConfigurationStrings.cs
- ScriptingProfileServiceSection.cs
- TypographyProperties.cs
- SelectionEditingBehavior.cs
- TemplateFactory.cs
- TdsValueSetter.cs
- XhtmlTextWriter.cs
- Input.cs
- OdbcUtils.cs
- JobPageOrder.cs
- ProfilePropertyNameValidator.cs
- MediaElementAutomationPeer.cs
- ContextQuery.cs
- DefaultSerializationProviderAttribute.cs
- ButtonBaseAdapter.cs
- ExpressionBuilder.cs
- EUCJPEncoding.cs
- XslVisitor.cs
- WebPartZone.cs
- Int32CollectionConverter.cs
- UrlMappingsModule.cs
- BufferedWebEventProvider.cs
- StringWriter.cs
- SqlMethodAttribute.cs
- XmlRootAttribute.cs
- TableItemProviderWrapper.cs
- EntityEntry.cs
- InputLanguageSource.cs
- ApplicationActivator.cs
- CharConverter.cs
- WindowsListViewSubItem.cs
- WeakEventManager.cs
- AuthenticationModuleElementCollection.cs
- PrivateFontCollection.cs
- HttpCapabilitiesSectionHandler.cs
- Logging.cs
- __FastResourceComparer.cs
- CustomErrorsSectionWrapper.cs
- NetTcpSecurityElement.cs
- FormViewUpdatedEventArgs.cs
- SettingsContext.cs
- SchemaImporterExtensionElementCollection.cs
- SqlRowUpdatingEvent.cs
- LocationUpdates.cs
- HttpCacheVaryByContentEncodings.cs
- FilterException.cs
- CrossSiteScriptingValidation.cs
- EndpointConfigContainer.cs
- PingReply.cs