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
- PrinterResolution.cs
- HierarchicalDataTemplate.cs
- QueryOperationResponseOfT.cs
- ReadOnlyDictionary.cs
- OdbcConnectionPoolProviderInfo.cs
- RootBuilder.cs
- SecurityIdentifierConverter.cs
- NullPackagingPolicy.cs
- NavigatorInput.cs
- _Win32.cs
- SmiRecordBuffer.cs
- InstalledFontCollection.cs
- ToolStripGrip.cs
- BinaryMessageEncodingElement.cs
- EventRoute.cs
- DSACryptoServiceProvider.cs
- _FixedSizeReader.cs
- SystemTcpStatistics.cs
- SqlDataSourceSelectingEventArgs.cs
- _ProxyRegBlob.cs
- NamedObject.cs
- Vector3DIndependentAnimationStorage.cs
- baseaxisquery.cs
- FileCodeGroup.cs
- QilGeneratorEnv.cs
- UserControlAutomationPeer.cs
- ColorMap.cs
- TextTreePropertyUndoUnit.cs
- SqlServer2KCompatibilityCheck.cs
- XmlBinaryReader.cs
- KeyValuePairs.cs
- DataGridTableStyleMappingNameEditor.cs
- AnimationStorage.cs
- BinaryKeyIdentifierClause.cs
- HtmlTextArea.cs
- Localizer.cs
- Matrix3D.cs
- WebPartZoneBaseDesigner.cs
- _DisconnectOverlappedAsyncResult.cs
- DrawListViewItemEventArgs.cs
- FileDialog.cs
- TextFindEngine.cs
- CompilationSection.cs
- TableChangeProcessor.cs
- ComplusEndpointConfigContainer.cs
- CharEnumerator.cs
- IntSecurity.cs
- HotSpotCollection.cs
- AnimationStorage.cs
- EncoderParameter.cs
- DecoderReplacementFallback.cs
- SQLDateTimeStorage.cs
- RenameRuleObjectDialog.Designer.cs
- NativeObjectSecurity.cs
- WmlTextBoxAdapter.cs
- CheckedPointers.cs
- EntityDataSourceDesignerHelper.cs
- DATA_BLOB.cs
- DeflateStream.cs
- LexicalChunk.cs
- TransactionInformation.cs
- HtmlInputPassword.cs
- SendMessageRecord.cs
- MediaTimeline.cs
- Vector3DValueSerializer.cs
- GeometryHitTestParameters.cs
- BasePropertyDescriptor.cs
- HtmlElementEventArgs.cs
- VBCodeProvider.cs
- MenuItemStyle.cs
- ErrorInfoXmlDocument.cs
- AssociationType.cs
- ParseHttpDate.cs
- HtmlLink.cs
- DataControlField.cs
- NativeMethods.cs
- StatusBarItemAutomationPeer.cs
- DataServiceRequest.cs
- InputLanguageManager.cs
- basemetadatamappingvisitor.cs
- PathTooLongException.cs
- DeploymentSection.cs
- ProfileSettings.cs
- TypeSystemProvider.cs
- TransportationConfigurationTypeInstallComponent.cs
- SymbolTable.cs
- selecteditemcollection.cs
- Typeface.cs
- EventPropertyMap.cs
- FontNamesConverter.cs
- PartBasedPackageProperties.cs
- TextServicesCompartment.cs
- HttpChannelHelper.cs
- AutoCompleteStringCollection.cs
- GradientStop.cs
- EntityModelSchemaGenerator.cs
- QilScopedVisitor.cs
- HtmlTableRowCollection.cs
- ContainerControl.cs
- Message.cs