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
- UnionExpr.cs
- PropagatorResult.cs
- StrongNamePublicKeyBlob.cs
- DataStreamFromComStream.cs
- StateFinalizationActivity.cs
- SubpageParagraph.cs
- RealProxy.cs
- ScriptResourceMapping.cs
- Matrix.cs
- ActivityTypeCodeDomSerializer.cs
- DataGridViewCellValidatingEventArgs.cs
- TextBoxAutoCompleteSourceConverter.cs
- DebugView.cs
- SqlClientWrapperSmiStream.cs
- MailBnfHelper.cs
- PackagePartCollection.cs
- PatternMatcher.cs
- ToolStripPanelRow.cs
- PropertyToken.cs
- CacheMemory.cs
- MexTcpBindingElement.cs
- DynamicRouteExpression.cs
- HandleCollector.cs
- CompilerError.cs
- ToolBarPanel.cs
- HtmlTableCell.cs
- XPathSelectionIterator.cs
- SystemParameters.cs
- DataQuery.cs
- TableRowsCollectionEditor.cs
- GridViewHeaderRowPresenter.cs
- ResourceDisplayNameAttribute.cs
- SqlMetaData.cs
- MainMenu.cs
- CodePageUtils.cs
- SettingsContext.cs
- KoreanCalendar.cs
- WindowsRichEdit.cs
- DataGridViewLinkColumn.cs
- PolicyUtility.cs
- MasterPageCodeDomTreeGenerator.cs
- DispatcherEventArgs.cs
- AsyncWaitHandle.cs
- UInt32Storage.cs
- UInt16Converter.cs
- ReferencedType.cs
- VisualBrush.cs
- ToolStripDropDownButton.cs
- WebBrowserHelper.cs
- DialogResultConverter.cs
- uribuilder.cs
- ConstNode.cs
- WebServiceClientProxyGenerator.cs
- DataGridLinkButton.cs
- OdbcTransaction.cs
- AutomationPeer.cs
- SmtpReplyReader.cs
- SizeKeyFrameCollection.cs
- InputScope.cs
- MaskedTextBox.cs
- FontStretch.cs
- AppDomainUnloadedException.cs
- BookmarkEventArgs.cs
- DispatcherOperation.cs
- AppDomainAttributes.cs
- BuildManagerHost.cs
- PerformanceCounterCategory.cs
- RenderData.cs
- MobileCategoryAttribute.cs
- Cursor.cs
- OracleDataReader.cs
- EntityTypeBase.cs
- documentsequencetextview.cs
- WorkflowMarkupSerializer.cs
- SqlXmlStorage.cs
- ResourcesChangeInfo.cs
- MenuBase.cs
- PassportPrincipal.cs
- ProfileEventArgs.cs
- HandlerBase.cs
- Point3DCollection.cs
- Wildcard.cs
- StubHelpers.cs
- CollectionBuilder.cs
- DropDownList.cs
- ObjectDataSourceDisposingEventArgs.cs
- MainMenu.cs
- ToolStripActionList.cs
- SharedTcpTransportManager.cs
- SoapInteropTypes.cs
- HandlerBase.cs
- BufferedStream.cs
- BigInt.cs
- BatchParser.cs
- Vector3DAnimationBase.cs
- Pen.cs
- SmtpLoginAuthenticationModule.cs
- Registry.cs
- SectionInformation.cs
- SelectionPattern.cs