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
- TextInfo.cs
- HtmlMeta.cs
- LogicalExpr.cs
- EndpointInstanceProvider.cs
- XmlSchemaObjectCollection.cs
- VSWCFServiceContractGenerator.cs
- DataSourceHelper.cs
- NamespaceListProperty.cs
- UrlPath.cs
- XmlSchemaObject.cs
- XsdBuildProvider.cs
- PermissionListSet.cs
- SessionEndedEventArgs.cs
- ClipboardProcessor.cs
- mil_sdk_version.cs
- WindowsEditBoxRange.cs
- MultiAsyncResult.cs
- ResourcesGenerator.cs
- HandleRef.cs
- ConnectionInterfaceCollection.cs
- ClientProtocol.cs
- DispatcherProcessingDisabled.cs
- PathStreamGeometryContext.cs
- DBAsyncResult.cs
- ClientOptions.cs
- WaitHandleCannotBeOpenedException.cs
- URL.cs
- LexicalChunk.cs
- OrderedDictionary.cs
- MemberDomainMap.cs
- EventSetter.cs
- ServiceObjectContainer.cs
- WpfXamlLoader.cs
- CalendarDesigner.cs
- UserUseLicenseDictionaryLoader.cs
- Token.cs
- ExternalException.cs
- ComEventsInfo.cs
- Transform3D.cs
- InkCanvasFeedbackAdorner.cs
- util.cs
- SecurityDescriptor.cs
- PrintControllerWithStatusDialog.cs
- IRCollection.cs
- WindowsGraphics2.cs
- ConfigXmlAttribute.cs
- FunctionParameter.cs
- COSERVERINFO.cs
- PathFigure.cs
- ButtonChrome.cs
- DBConnection.cs
- FontClient.cs
- StyleModeStack.cs
- XomlCompilerResults.cs
- FrameDimension.cs
- FixedPageProcessor.cs
- _BaseOverlappedAsyncResult.cs
- ResourceType.cs
- TTSEvent.cs
- ReadOnlyDictionary.cs
- CodeTypeParameterCollection.cs
- DiscoveryOperationContext.cs
- SimpleType.cs
- Inflater.cs
- StringWriter.cs
- ArrayList.cs
- Native.cs
- TimelineClockCollection.cs
- OperationPerformanceCounters.cs
- DbSourceCommand.cs
- SqlConnection.cs
- FlowDocumentFormatter.cs
- BaseTemplateBuildProvider.cs
- TextTrailingWordEllipsis.cs
- HtmlTable.cs
- SqlDataAdapter.cs
- RtfControlWordInfo.cs
- _StreamFramer.cs
- DataListCommandEventArgs.cs
- WebBrowserNavigatedEventHandler.cs
- DynamicPropertyReader.cs
- HttpCachePolicy.cs
- GeneralTransformCollection.cs
- SizeAnimationBase.cs
- ClusterSafeNativeMethods.cs
- ReadOnlyDictionary.cs
- StrokeSerializer.cs
- CryptoApi.cs
- DigestTraceRecordHelper.cs
- XmlNullResolver.cs
- EventDescriptor.cs
- SkinBuilder.cs
- FlowLayoutSettings.cs
- SystemIPv4InterfaceProperties.cs
- DiagnosticsConfigurationHandler.cs
- ColumnMap.cs
- ConnectionPoint.cs
- ConfigPathUtility.cs
- ValidationError.cs
- PropertyGridView.cs