Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- BitmapPalette.cs
- ProofTokenCryptoHandle.cs
- OpenFileDialog.cs
- thaishape.cs
- BufferedGraphicsManager.cs
- DataTableReader.cs
- HttpListener.cs
- StateMachineDesignerPaint.cs
- Utils.cs
- SqlTriggerContext.cs
- IndentTextWriter.cs
- FeatureSupport.cs
- DesignerHost.cs
- BasicDesignerLoader.cs
- Hex.cs
- Collection.cs
- FileInfo.cs
- TransformConverter.cs
- IPEndPointCollection.cs
- MiniMapControl.xaml.cs
- DataGridViewCellPaintingEventArgs.cs
- TempFiles.cs
- SqlInternalConnectionTds.cs
- KnownTypesHelper.cs
- ResourceType.cs
- ConfigXmlCDataSection.cs
- Script.cs
- DrawingImage.cs
- EncodingNLS.cs
- RenderTargetBitmap.cs
- DateTimeUtil.cs
- Normalizer.cs
- SafeCloseHandleCritical.cs
- MeasurementDCInfo.cs
- TextRangeSerialization.cs
- TextRangeProviderWrapper.cs
- ComponentChangedEvent.cs
- ProfileEventArgs.cs
- DataControlImageButton.cs
- BinaryParser.cs
- PointCollectionValueSerializer.cs
- GroupQuery.cs
- ModuleBuilderData.cs
- NativeMethods.cs
- DbModificationCommandTree.cs
- Imaging.cs
- shaper.cs
- SamlSecurityTokenAuthenticator.cs
- WebPartHeaderCloseVerb.cs
- TimeStampChecker.cs
- DecodeHelper.cs
- GeneralTransformCollection.cs
- XmlAttributes.cs
- FusionWrap.cs
- Debug.cs
- OraclePermission.cs
- MsmqHostedTransportManager.cs
- CodeDirectiveCollection.cs
- FramingEncoders.cs
- ImageMapEventArgs.cs
- ToolBar.cs
- ColumnReorderedEventArgs.cs
- SiteOfOriginPart.cs
- RunInstallerAttribute.cs
- MailAddress.cs
- Utils.cs
- Attribute.cs
- CompositionAdorner.cs
- ControlPager.cs
- HotCommands.cs
- controlskin.cs
- RevocationPoint.cs
- MenuCommands.cs
- ArrayElementGridEntry.cs
- JsonGlobals.cs
- IIS7UserPrincipal.cs
- DocumentXmlWriter.cs
- MultiPageTextView.cs
- DesignerView.cs
- JsonDataContract.cs
- ClientSideQueueItem.cs
- CDSsyncETWBCLProvider.cs
- BitmapPalettes.cs
- SqlConnectionString.cs
- EntitySqlQueryState.cs
- SelectionProcessor.cs
- MailFileEditor.cs
- DrawingCollection.cs
- TemplateInstanceAttribute.cs
- TimelineGroup.cs
- Message.cs
- SplineKeyFrames.cs
- Win32.cs
- EntityContainerAssociationSet.cs
- EntityKeyElement.cs
- PageParser.cs
- PresentationAppDomainManager.cs
- ListBindableAttribute.cs
- SiteMapNode.cs
- AutomationPeer.cs