Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- ObjectViewQueryResultData.cs
- XMLSyntaxException.cs
- DtdParser.cs
- SettingsProviderCollection.cs
- FacetDescription.cs
- HostSecurityManager.cs
- RSAOAEPKeyExchangeDeformatter.cs
- CaseInsensitiveHashCodeProvider.cs
- DuplicateWaitObjectException.cs
- XmlSchemaObjectTable.cs
- SoapHttpTransportImporter.cs
- IList.cs
- COAUTHINFO.cs
- ContentIterators.cs
- Msmq3PoisonHandler.cs
- ObjectListCommandsPage.cs
- NativeMethods.cs
- TemplatedMailWebEventProvider.cs
- DropSourceBehavior.cs
- XamlGridLengthSerializer.cs
- ConnectionPoolManager.cs
- Helpers.cs
- ReadOnlyHierarchicalDataSource.cs
- ClientSettingsSection.cs
- GlyphRun.cs
- QueryCacheKey.cs
- OdbcCommandBuilder.cs
- SQLDecimal.cs
- MethodSignatureGenerator.cs
- ClientSideQueueItem.cs
- XmlBinaryReader.cs
- Accessible.cs
- GridViewEditEventArgs.cs
- IssuanceTokenProviderBase.cs
- ParseNumbers.cs
- XhtmlMobileTextWriter.cs
- TransformConverter.cs
- COM2Properties.cs
- Lease.cs
- BinaryObjectReader.cs
- BufferedWebEventProvider.cs
- UniqueIdentifierService.cs
- XmlnsPrefixAttribute.cs
- LinqDataSource.cs
- ScrollChrome.cs
- TdsRecordBufferSetter.cs
- ExtenderProviderService.cs
- ExtractedStateEntry.cs
- SpeakProgressEventArgs.cs
- DataBinder.cs
- Rectangle.cs
- DataGridCellAutomationPeer.cs
- WsatTransactionFormatter.cs
- DesignerActionHeaderItem.cs
- Number.cs
- StateMachineWorkflowDesigner.cs
- CodeCompileUnit.cs
- SymbolTable.cs
- WebPartTransformer.cs
- Environment.cs
- AvTraceDetails.cs
- DateTimeSerializationSection.cs
- TabControlEvent.cs
- Errors.cs
- DbExpressionVisitor.cs
- OneToOneMappingSerializer.cs
- ResourceExpressionEditor.cs
- CommonProperties.cs
- EventLevel.cs
- Brush.cs
- ExceptionHelpers.cs
- AdPostCacheSubstitution.cs
- ReadOnlyMetadataCollection.cs
- EdmType.cs
- BrowserDefinition.cs
- SelectionRangeConverter.cs
- FontUnitConverter.cs
- SqlGatherConsumedAliases.cs
- BufferedGraphics.cs
- PermissionRequestEvidence.cs
- ResourceProviderFactory.cs
- XmlIgnoreAttribute.cs
- TiffBitmapDecoder.cs
- DuplicateDetector.cs
- ScrollChrome.cs
- MergeFilterQuery.cs
- RawStylusInputCustomDataList.cs
- FileRecordSequence.cs
- SqlBulkCopy.cs
- HttpHandler.cs
- TemplateColumn.cs
- unitconverter.cs
- EventLogPermission.cs
- DesignerTransaction.cs
- SizeAnimationUsingKeyFrames.cs
- SystemNetHelpers.cs
- DisplayInformation.cs
- PaintEvent.cs
- PropertyStore.cs
- EntityClassGenerator.cs