Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- PersistenceProviderElement.cs
- RenderDataDrawingContext.cs
- XmlSerializer.cs
- RegexTree.cs
- DurableInstanceProvider.cs
- ContainerActivationHelper.cs
- HwndSource.cs
- ReadOnlyHierarchicalDataSourceView.cs
- Propagator.JoinPropagator.JoinPredicateVisitor.cs
- PageRequestManager.cs
- XmlKeywords.cs
- RemoveStoryboard.cs
- DataObjectFieldAttribute.cs
- CollectionEditorDialog.cs
- ProjectionCamera.cs
- HtmlInputFile.cs
- ChannelBinding.cs
- TextRangeAdaptor.cs
- COM2PropertyBuilderUITypeEditor.cs
- DataGridTablesFactory.cs
- NamedPipeAppDomainProtocolHandler.cs
- ForwardPositionQuery.cs
- ExplicitDiscriminatorMap.cs
- UnsafeNativeMethods.cs
- RenamedEventArgs.cs
- MulticastNotSupportedException.cs
- TextTreeTextNode.cs
- AutomationPattern.cs
- DataFieldEditor.cs
- MethodRental.cs
- ListItemCollection.cs
- MenuCommands.cs
- LicenseContext.cs
- IIS7WorkerRequest.cs
- CodeBlockBuilder.cs
- LicenseContext.cs
- DesignerAttribute.cs
- ProfessionalColors.cs
- Point3DAnimationUsingKeyFrames.cs
- DirectoryInfo.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- ProfessionalColors.cs
- ConnectionStringSettings.cs
- NavigationEventArgs.cs
- CodeTypeMemberCollection.cs
- SafeSecurityHelper.cs
- SqlHelper.cs
- UnsafeCollabNativeMethods.cs
- ColumnBinding.cs
- DataTableExtensions.cs
- MemberPath.cs
- LayoutTableCell.cs
- PathFigureCollection.cs
- FactoryGenerator.cs
- RadioButtonAutomationPeer.cs
- PointF.cs
- ConstrainedDataObject.cs
- GeometryModel3D.cs
- WindowsSolidBrush.cs
- X509Utils.cs
- GlyphsSerializer.cs
- AttributeParameterInfo.cs
- InstanceOwner.cs
- RTLAwareMessageBox.cs
- ManagementPath.cs
- OutOfProcStateClientManager.cs
- PermissionToken.cs
- TextTreeTextBlock.cs
- HeaderedItemsControl.cs
- Calendar.cs
- OverflowException.cs
- FloaterParagraph.cs
- MonikerHelper.cs
- ToggleButtonAutomationPeer.cs
- ManipulationLogic.cs
- _BasicClient.cs
- ComEventsInfo.cs
- HwndKeyboardInputProvider.cs
- X509Logo.cs
- GroupItemAutomationPeer.cs
- SubqueryTrackingVisitor.cs
- SchemaCollectionPreprocessor.cs
- MenuItemStyleCollectionEditor.cs
- WindowsListViewGroupHelper.cs
- NativeMethods.cs
- Track.cs
- DesigntimeLicenseContextSerializer.cs
- SecurityPolicySection.cs
- ImageEditor.cs
- ListCollectionView.cs
- ResourceReferenceExpressionConverter.cs
- Win32Exception.cs
- SafeSecurityHelper.cs
- EnterpriseServicesHelper.cs
- TypeBuilder.cs
- XmlIterators.cs
- FirstMatchCodeGroup.cs
- DivideByZeroException.cs
- DefaultParameterValueAttribute.cs
- NullableDoubleMinMaxAggregationOperator.cs