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
- AppliesToBehaviorDecisionTable.cs
- DirectoryObjectSecurity.cs
- Root.cs
- streamingZipPartStream.cs
- TypeDependencyAttribute.cs
- DocumentProperties.cs
- TopClause.cs
- HtmlTernaryTree.cs
- HostedHttpRequestAsyncResult.cs
- DataSetMappper.cs
- HtmlInputControl.cs
- MatrixAnimationUsingKeyFrames.cs
- EventBookmark.cs
- CheckBox.cs
- __ComObject.cs
- InstanceLockLostException.cs
- CharAnimationUsingKeyFrames.cs
- AssemblyResourceLoader.cs
- DefaultPrintController.cs
- KnownTypesProvider.cs
- ConfigurationStrings.cs
- HierarchicalDataSourceControl.cs
- PackWebRequestFactory.cs
- WorkflowViewStateService.cs
- Int16AnimationBase.cs
- GridViewUpdatedEventArgs.cs
- RangeValidator.cs
- NativeMethodsCLR.cs
- MouseActionValueSerializer.cs
- BasicCellRelation.cs
- DataGridViewCellCollection.cs
- ExtensibleSyndicationObject.cs
- OdbcConnectionHandle.cs
- DefaultEventAttribute.cs
- EventProviderWriter.cs
- EntityDataSourceWrapperCollection.cs
- XmlObjectSerializerWriteContextComplex.cs
- PolyBezierSegment.cs
- SecuritySessionSecurityTokenProvider.cs
- SchemaDeclBase.cs
- HttpWebRequest.cs
- Win32Native.cs
- IPGlobalProperties.cs
- MethodCallConverter.cs
- SafeWaitHandle.cs
- FormsAuthenticationUser.cs
- Size.cs
- Label.cs
- BamlResourceDeserializer.cs
- CodeFieldReferenceExpression.cs
- TransformerConfigurationWizardBase.cs
- LinqDataSourceContextEventArgs.cs
- NavigationProgressEventArgs.cs
- ContactManager.cs
- CopyOnWriteList.cs
- PerfProviderCollection.cs
- SurrogateDataContract.cs
- JsonServiceDocumentSerializer.cs
- ActivityValidator.cs
- DataViewSetting.cs
- DurableInstanceManager.cs
- UserValidatedEventArgs.cs
- WebResourceUtil.cs
- KeyFrames.cs
- PagesSection.cs
- SiteMapNode.cs
- SqlSelectStatement.cs
- XPathAxisIterator.cs
- HttpProfileBase.cs
- ShaderEffect.cs
- WorkflowPersistenceContext.cs
- SqlProviderManifest.cs
- OracleTimeSpan.cs
- SortedList.cs
- DescendantOverDescendantQuery.cs
- PathFigureCollection.cs
- SecurityVersion.cs
- CommandHelpers.cs
- Baml2006ReaderSettings.cs
- CodeDOMUtility.cs
- WithStatement.cs
- ProcessHostServerConfig.cs
- UnsafeNativeMethods.cs
- SafeTimerHandle.cs
- SoapSchemaMember.cs
- VisualCollection.cs
- UInt16Converter.cs
- NavigationFailedEventArgs.cs
- COM2Properties.cs
- DataGrid.cs
- AsyncResult.cs
- DeferredRunTextReference.cs
- TemplateControlCodeDomTreeGenerator.cs
- EncoderBestFitFallback.cs
- ReflectionServiceProvider.cs
- RouteTable.cs
- BuildProviderCollection.cs
- ServerValidateEventArgs.cs
- DbMetaDataCollectionNames.cs
- EnumerableRowCollectionExtensions.cs