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
- XmlNamespaceManager.cs
- ClientReliableChannelBinder.cs
- SBCSCodePageEncoding.cs
- BufferedStream.cs
- AlphaSortedEnumConverter.cs
- RoleManagerEventArgs.cs
- Knowncolors.cs
- PropertyTabAttribute.cs
- ProtocolElement.cs
- PerformanceCounter.cs
- FixedStringLookup.cs
- Rule.cs
- BooleanToVisibilityConverter.cs
- StorageAssociationTypeMapping.cs
- MouseOverProperty.cs
- QueryCacheKey.cs
- TraceContext.cs
- WorkflowInstanceTerminatedRecord.cs
- WrappedReader.cs
- JsonUriDataContract.cs
- ListBoxItemAutomationPeer.cs
- AuthenticationSection.cs
- EndCreateSecurityTokenRequest.cs
- Rules.cs
- HtmlInputControl.cs
- SQLDateTime.cs
- HttpCookieCollection.cs
- ProgressBarRenderer.cs
- LinqDataSourceDisposeEventArgs.cs
- SystemWebExtensionsSectionGroup.cs
- CodeDOMProvider.cs
- UserInitiatedRoutedEventPermissionAttribute.cs
- DBParameter.cs
- UnsafeNativeMethods.cs
- SaveFileDialog.cs
- DBCSCodePageEncoding.cs
- Form.cs
- EasingFunctionBase.cs
- EdmToObjectNamespaceMap.cs
- XPathScanner.cs
- MembershipSection.cs
- QuerySetOp.cs
- ResourceDescriptionAttribute.cs
- PersonalizationDictionary.cs
- TemplateXamlTreeBuilder.cs
- CustomWebEventKey.cs
- PageThemeCodeDomTreeGenerator.cs
- WrapperEqualityComparer.cs
- HandlerWithFactory.cs
- AssemblyAssociatedContentFileAttribute.cs
- PathSegmentCollection.cs
- HMACSHA1.cs
- DropSource.cs
- TableHeaderCell.cs
- StylusPointPropertyUnit.cs
- EditorPartChrome.cs
- QueryStoreStatusRequest.cs
- ObjectDataSourceView.cs
- UnSafeCharBuffer.cs
- HierarchicalDataBoundControlAdapter.cs
- XmlDataFileEditor.cs
- TextParentUndoUnit.cs
- AssemblyAttributes.cs
- WinFormsSecurity.cs
- AlternateView.cs
- ActivitySurrogateSelector.cs
- GridViewHeaderRowPresenter.cs
- ActivityCodeDomSerializer.cs
- ProtocolsConfiguration.cs
- RemotingAttributes.cs
- ValidationResult.cs
- CodeChecksumPragma.cs
- MetafileHeader.cs
- DataGridViewUtilities.cs
- EasingKeyFrames.cs
- CollectionChangedEventManager.cs
- SelectionChangedEventArgs.cs
- TextViewSelectionProcessor.cs
- OpCodes.cs
- CustomAttributeBuilder.cs
- BuildProviderAppliesToAttribute.cs
- MultiPageTextView.cs
- SqlProfileProvider.cs
- Fx.cs
- IsolatedStorage.cs
- PageParserFilter.cs
- DataControlFieldCollection.cs
- FontNamesConverter.cs
- Array.cs
- HighContrastHelper.cs
- DynamicILGenerator.cs
- PenContexts.cs
- DashStyle.cs
- SoapMessage.cs
- QilChoice.cs
- ObjectDataSourceDisposingEventArgs.cs
- ConfigurationException.cs
- LZCodec.cs
- Link.cs
- HttpResponseHeader.cs