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
- Encoding.cs
- SchemaImporterExtension.cs
- UIElementHelper.cs
- RC2.cs
- SqlCrossApplyToCrossJoin.cs
- InstanceCollisionException.cs
- EntitySetBase.cs
- GlyphRunDrawing.cs
- MessageQueueTransaction.cs
- EmptyStringExpandableObjectConverter.cs
- PrintDialog.cs
- PartitionResolver.cs
- prefixendpointaddressmessagefiltertable.cs
- TitleStyle.cs
- RegionIterator.cs
- GenericRootAutomationPeer.cs
- OdbcHandle.cs
- ResolveNameEventArgs.cs
- ServiceOperationParameter.cs
- EdmSchemaError.cs
- Literal.cs
- RadioButtonStandardAdapter.cs
- TextChangedEventArgs.cs
- HtmlInputControl.cs
- DBCSCodePageEncoding.cs
- TreeNodeCollectionEditor.cs
- ComplexPropertyEntry.cs
- ResourceWriter.cs
- QueryResult.cs
- ToolStripDropDownMenu.cs
- NativeMethods.cs
- ExceptionList.cs
- MatrixAnimationUsingPath.cs
- ZipIORawDataFileBlock.cs
- HyperLinkField.cs
- EntityDataSourceEntityTypeFilterConverter.cs
- StateRuntime.cs
- XmlHierarchicalDataSourceView.cs
- DataGridViewTextBoxColumn.cs
- EditorPartChrome.cs
- CellParagraph.cs
- BitmapDecoder.cs
- StringFormat.cs
- KeyValuePair.cs
- ObjectDataSourceView.cs
- TdsValueSetter.cs
- Stroke2.cs
- FontStyle.cs
- RadioButton.cs
- TextEditor.cs
- DescendentsWalkerBase.cs
- BitmapMetadataBlob.cs
- externdll.cs
- WindowsServiceCredential.cs
- XmlSchemaSet.cs
- StaticSiteMapProvider.cs
- EncoderNLS.cs
- BitmapDecoder.cs
- UnsafeNativeMethods.cs
- CultureTableRecord.cs
- DesigntimeLicenseContext.cs
- StringUtil.cs
- SchemaInfo.cs
- RestClientProxyHandler.cs
- MergeLocalizationDirectives.cs
- BindingCompleteEventArgs.cs
- loginstatus.cs
- BamlRecords.cs
- EventLogInternal.cs
- XamlSerializationHelper.cs
- LambdaCompiler.Unary.cs
- CompositeScriptReference.cs
- AttachmentService.cs
- ScaleTransform.cs
- EditingMode.cs
- ColorBlend.cs
- XmlBuffer.cs
- MemoryPressure.cs
- Column.cs
- GuidConverter.cs
- GenericsNotImplementedException.cs
- ListComponentEditorPage.cs
- ConnectivityStatus.cs
- Italic.cs
- SoapUnknownHeader.cs
- UnicodeEncoding.cs
- IISUnsafeMethods.cs
- EntityUtil.cs
- IdSpace.cs
- HGlobalSafeHandle.cs
- InheritanceContextChangedEventManager.cs
- ControlBindingsConverter.cs
- SolidColorBrush.cs
- XPathNodeHelper.cs
- DefaultEvaluationContext.cs
- FigureParaClient.cs
- linebase.cs
- WorkItem.cs
- SafeLocalMemHandle.cs
- propertyentry.cs