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
- CachedFontFamily.cs
- QilXmlWriter.cs
- LabelEditEvent.cs
- Brush.cs
- MatrixCamera.cs
- SelectionHighlightInfo.cs
- UserControlBuildProvider.cs
- CodeConditionStatement.cs
- TemplateControlCodeDomTreeGenerator.cs
- DesignTimeParseData.cs
- DetailsViewInsertedEventArgs.cs
- SecurityElement.cs
- SaveFileDialog.cs
- SystemTcpConnection.cs
- ProfileSection.cs
- CustomMenuItemCollection.cs
- StringStorage.cs
- FileCodeGroup.cs
- DocumentViewerBase.cs
- TransformerInfo.cs
- SecurityPermission.cs
- XmlSchemaDocumentation.cs
- CursorConverter.cs
- StateMachineHelpers.cs
- ExtenderControl.cs
- EventSourceCreationData.cs
- MenuItem.cs
- WebServiceBindingAttribute.cs
- ValidationHelpers.cs
- ParseChildrenAsPropertiesAttribute.cs
- PropertyTab.cs
- DNS.cs
- ForeignKeyConstraint.cs
- QueryStatement.cs
- MailHeaderInfo.cs
- PipeStream.cs
- PrintingPermission.cs
- JsonEncodingStreamWrapper.cs
- MultiDataTrigger.cs
- OdbcConnectionHandle.cs
- OutputScope.cs
- LoginCancelEventArgs.cs
- InsufficientMemoryException.cs
- PropertyEmitterBase.cs
- TraceRecord.cs
- RichTextBox.cs
- ClientBuildManagerCallback.cs
- AutomationPeer.cs
- ClientSettingsStore.cs
- GlobalizationSection.cs
- DbParameterCollection.cs
- AmbientLight.cs
- ToggleButtonAutomationPeer.cs
- TemplateControl.cs
- TextEncodedRawTextWriter.cs
- GridViewColumn.cs
- DataGridViewCellStyle.cs
- RestClientProxyHandler.cs
- EmptyStringExpandableObjectConverter.cs
- SHA1CryptoServiceProvider.cs
- Crypto.cs
- WorkflowInstanceExtensionProvider.cs
- DataGridViewDataConnection.cs
- CustomAssemblyResolver.cs
- QueryableDataSourceEditData.cs
- CustomValidator.cs
- WmlImageAdapter.cs
- DesignTimeVisibleAttribute.cs
- WebScriptEnablingElement.cs
- CountAggregationOperator.cs
- Assert.cs
- InkCanvasFeedbackAdorner.cs
- WorkflowApplicationTerminatedException.cs
- SocketException.cs
- EditBehavior.cs
- ProxyElement.cs
- LiteralDesigner.cs
- ContextMenuStripGroup.cs
- XmlDictionaryWriter.cs
- XXXOnTypeBuilderInstantiation.cs
- MatrixConverter.cs
- TdsParserStaticMethods.cs
- LoadedOrUnloadedOperation.cs
- ProfessionalColorTable.cs
- MimeMapping.cs
- NonBatchDirectoryCompiler.cs
- InputEventArgs.cs
- ResolveNameEventArgs.cs
- XmlDesignerDataSourceView.cs
- HybridObjectCache.cs
- Command.cs
- RequestReplyCorrelator.cs
- IndexerReference.cs
- WebPartMinimizeVerb.cs
- HandleCollector.cs
- SystemIcmpV6Statistics.cs
- FixUpCollection.cs
- IList.cs
- ProfileInfo.cs
- ExpressionWriter.cs