Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Configuration / System / Configuration / ProtectedConfiguration.cs / 1305376 / 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
- OracleConnectionFactory.cs
- ReflectionTypeLoadException.cs
- SqlProvider.cs
- Matrix3DConverter.cs
- WebPartEditorOkVerb.cs
- FileClassifier.cs
- ThicknessAnimationUsingKeyFrames.cs
- ExpressionServices.cs
- DataGridItemCollection.cs
- ProofTokenCryptoHandle.cs
- XmlSchemaSimpleContentRestriction.cs
- OleDbCommand.cs
- DesignerActionHeaderItem.cs
- SchemaEntity.cs
- SerializationStore.cs
- OletxVolatileEnlistment.cs
- Underline.cs
- HwndStylusInputProvider.cs
- CategoryEditor.cs
- DataKeyArray.cs
- BamlLocalizableResourceKey.cs
- DataGridViewCellPaintingEventArgs.cs
- ArgIterator.cs
- DesignerRegionMouseEventArgs.cs
- UshortList2.cs
- PartialCachingControl.cs
- PanningMessageFilter.cs
- SqlDelegatedTransaction.cs
- RightNameExpirationInfoPair.cs
- NotFiniteNumberException.cs
- DelegatedStream.cs
- latinshape.cs
- HwndSourceKeyboardInputSite.cs
- ProfilePropertySettingsCollection.cs
- SoapEnumAttribute.cs
- ValueOfAction.cs
- MediaElement.cs
- SchemaCollectionPreprocessor.cs
- FileDetails.cs
- CustomAttributeSerializer.cs
- EnterpriseServicesHelper.cs
- MsmqDiagnostics.cs
- DataServiceProviderMethods.cs
- SequentialWorkflowRootDesigner.cs
- WebConvert.cs
- BulletChrome.cs
- WsdlInspector.cs
- DocumentSequenceHighlightLayer.cs
- SecurityContext.cs
- ellipse.cs
- ObjectStateManagerMetadata.cs
- CorrelationHandle.cs
- DbReferenceCollection.cs
- TriState.cs
- DataGridHelper.cs
- PinnedBufferMemoryStream.cs
- AnnotationAuthorChangedEventArgs.cs
- HandleRef.cs
- UTF32Encoding.cs
- DataGridTable.cs
- IInstanceTable.cs
- MarshalByRefObject.cs
- PageAdapter.cs
- Splitter.cs
- DataGridViewRowPrePaintEventArgs.cs
- PropertySourceInfo.cs
- CqlWriter.cs
- HwndHostAutomationPeer.cs
- WebPartEditorCancelVerb.cs
- _NegoStream.cs
- NonClientArea.cs
- NestedContainer.cs
- SystemWebCachingSectionGroup.cs
- entityreference_tresulttype.cs
- CodeTypeOfExpression.cs
- ModelVisual3D.cs
- DataKeyCollection.cs
- SmtpDigestAuthenticationModule.cs
- TextUtf8RawTextWriter.cs
- DataGridViewCellStyleChangedEventArgs.cs
- EmissiveMaterial.cs
- ButtonChrome.cs
- ComPlusServiceHost.cs
- SettingsProperty.cs
- SecurityDescriptor.cs
- UdpChannelFactory.cs
- SymmetricAlgorithm.cs
- JoinElimination.cs
- TextRangeBase.cs
- StreamInfo.cs
- DSASignatureDeformatter.cs
- DesignerHelpers.cs
- Table.cs
- ListViewItem.cs
- HttpListenerPrefixCollection.cs
- VectorConverter.cs
- SqlInfoMessageEvent.cs
- webproxy.cs
- PrintingPermission.cs
- ReflectEventDescriptor.cs