Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- EventLogPermissionAttribute.cs
- EditorZoneBase.cs
- StylusOverProperty.cs
- Themes.cs
- FacetEnabledSchemaElement.cs
- InheritanceContextHelper.cs
- infer.cs
- WeakEventManager.cs
- BitmapEffectrendercontext.cs
- HostingEnvironmentWrapper.cs
- BindingsCollection.cs
- CodeTypeReferenceCollection.cs
- EtwTrackingBehaviorElement.cs
- GridViewCommandEventArgs.cs
- RepeaterItemCollection.cs
- DescendantQuery.cs
- ReadWriteSpinLock.cs
- HttpResponseMessageProperty.cs
- DataGridRelationshipRow.cs
- WebPartEditVerb.cs
- WinFormsSpinner.cs
- ArrayMergeHelper.cs
- InvalidAsynchronousStateException.cs
- InternalPermissions.cs
- WebPartCloseVerb.cs
- XmlEncoding.cs
- XmlDataCollection.cs
- DNS.cs
- FloaterBaseParagraph.cs
- PrintControllerWithStatusDialog.cs
- TextViewBase.cs
- AddingNewEventArgs.cs
- mediaeventshelper.cs
- TextBoxAutomationPeer.cs
- CompositeDuplexElement.cs
- ExtensionWindow.cs
- DotAtomReader.cs
- TypeHelper.cs
- HtmlContainerControl.cs
- RestHandlerFactory.cs
- ObjectDataSourceStatusEventArgs.cs
- CultureInfoConverter.cs
- ChooseAction.cs
- XmlSchemaChoice.cs
- MarkupExtensionParser.cs
- Selection.cs
- XmlMessageFormatter.cs
- Viewport3DAutomationPeer.cs
- TickBar.cs
- GridViewColumn.cs
- NavigatingCancelEventArgs.cs
- MessageAction.cs
- ListViewInsertedEventArgs.cs
- Identity.cs
- SafeUserTokenHandle.cs
- Brush.cs
- MiniConstructorInfo.cs
- QilTypeChecker.cs
- ListViewEditEventArgs.cs
- GenericTextProperties.cs
- WebPartTransformerAttribute.cs
- CheckBoxField.cs
- EditorPartCollection.cs
- EntityDataSourceEntityTypeFilterConverter.cs
- TableItemPatternIdentifiers.cs
- URLAttribute.cs
- TextServicesHost.cs
- Logging.cs
- TraceContextRecord.cs
- CatalogZoneDesigner.cs
- HttpCacheVaryByContentEncodings.cs
- PrintDialogException.cs
- EventToken.cs
- SoapAttributeAttribute.cs
- FileStream.cs
- RegistryDataKey.cs
- FormattedTextSymbols.cs
- _KerberosClient.cs
- BinaryKeyIdentifierClause.cs
- Clipboard.cs
- ScrollableControl.cs
- DefaultHttpHandler.cs
- ProfilePropertySettings.cs
- ISAPIRuntime.cs
- NetworkCredential.cs
- SByteConverter.cs
- CompareInfo.cs
- SubMenuStyleCollectionEditor.cs
- ResourceDefaultValueAttribute.cs
- BaseParaClient.cs
- ConvertEvent.cs
- TrustManagerMoreInformation.cs
- TextBlock.cs
- RangeContentEnumerator.cs
- MediaContext.cs
- Baml2006ReaderSettings.cs
- DateTimeFormat.cs
- SourceInterpreter.cs
- TCPListener.cs
- ExpressionBuilder.cs