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
- ObjectKeyFrameCollection.cs
- Property.cs
- Geometry3D.cs
- MarkupObject.cs
- RegexCaptureCollection.cs
- CancellationHandlerDesigner.cs
- FixedSchema.cs
- IRCollection.cs
- TextPointerBase.cs
- CreateSequenceResponse.cs
- Journal.cs
- Process.cs
- BinaryFormatterWriter.cs
- BackgroundFormatInfo.cs
- DataGridViewAddColumnDialog.cs
- UIPropertyMetadata.cs
- DriveInfo.cs
- InternalTypeHelper.cs
- IssuanceLicense.cs
- BamlStream.cs
- PeerCredentialElement.cs
- SweepDirectionValidation.cs
- CompilationUnit.cs
- CustomAttributeSerializer.cs
- Tuple.cs
- Processor.cs
- TableItemStyle.cs
- TargetException.cs
- SynchronizedDispatch.cs
- SqlDependencyListener.cs
- Part.cs
- StringSorter.cs
- RegexBoyerMoore.cs
- X509PeerCertificateAuthentication.cs
- CodeObjectCreateExpression.cs
- PrefixQName.cs
- PersonalizationStateInfo.cs
- KerberosSecurityTokenProvider.cs
- RelatedImageListAttribute.cs
- DbExpressionBuilder.cs
- PrintPreviewControl.cs
- SerializationSectionGroup.cs
- FilteredDataSetHelper.cs
- SecurityHeaderLayout.cs
- OperationContractGenerationContext.cs
- SuppressMergeCheckAttribute.cs
- BuilderPropertyEntry.cs
- ContentPlaceHolder.cs
- Tool.cs
- SizeConverter.cs
- ControlCachePolicy.cs
- CryptographicAttribute.cs
- CreateUserWizard.cs
- BasicExpandProvider.cs
- ExpressionReplacer.cs
- VisualStyleRenderer.cs
- EntityDataSourceStatementEditorForm.cs
- HeaderUtility.cs
- TypeHelpers.cs
- ThreadSafeList.cs
- DataTablePropertyDescriptor.cs
- XmlAttributes.cs
- UserNameSecurityTokenProvider.cs
- FileLogRecord.cs
- ReliableOutputConnection.cs
- SqlBinder.cs
- TreeNodeSelectionProcessor.cs
- XmlIncludeAttribute.cs
- BackgroundFormatInfo.cs
- AttributeQuery.cs
- DataGridViewMethods.cs
- WindowsFormsHostPropertyMap.cs
- GridViewDeleteEventArgs.cs
- TypeConverterMarkupExtension.cs
- MenuItemBinding.cs
- IgnorePropertiesAttribute.cs
- TraceRecord.cs
- ProfileInfo.cs
- coordinatorscratchpad.cs
- FormViewDeleteEventArgs.cs
- CalendarDay.cs
- X509CertificateStore.cs
- ExpiredSecurityTokenException.cs
- CreateRefExpr.cs
- TypeValidationEventArgs.cs
- DeflateInput.cs
- CollectionContainer.cs
- Vector3dCollection.cs
- ShaperBuffers.cs
- ListViewItem.cs
- HttpSessionStateBase.cs
- CompositeCollectionView.cs
- StyleModeStack.cs
- ToolstripProfessionalRenderer.cs
- ResourcesChangeInfo.cs
- SoapMessage.cs
- BinHexEncoder.cs
- _MultipleConnectAsync.cs
- JsonXmlDataContract.cs
- SoapAttributeOverrides.cs