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
- DeviceContexts.cs
- EncoderFallback.cs
- SqlServer2KCompatibilityCheck.cs
- FormatterServices.cs
- Pick.cs
- XamlFigureLengthSerializer.cs
- Constants.cs
- EncryptedData.cs
- CertificateManager.cs
- DesignConnectionCollection.cs
- ParameterCollection.cs
- XmlRawWriterWrapper.cs
- FileDialog_Vista.cs
- CodeArrayCreateExpression.cs
- XmlWriter.cs
- Mappings.cs
- SQLDoubleStorage.cs
- SignatureHelper.cs
- EUCJPEncoding.cs
- ProtocolsSection.cs
- CustomLineCap.cs
- QilTernary.cs
- EncryptedKeyIdentifierClause.cs
- DotNetATv1WindowsLogEntryDeserializer.cs
- WindowsContainer.cs
- Decimal.cs
- SoapMessage.cs
- PerformanceCounterLib.cs
- securitycriticaldata.cs
- JobInputBins.cs
- DiagnosticsConfigurationHandler.cs
- TypeGeneratedEventArgs.cs
- SelectionProviderWrapper.cs
- InplaceBitmapMetadataWriter.cs
- TypeBuilder.cs
- Literal.cs
- DataBoundControlParameterTarget.cs
- EmptyControlCollection.cs
- ScriptHandlerFactory.cs
- PropertyChangedEventArgs.cs
- NavigationEventArgs.cs
- CheckPair.cs
- XPathPatternParser.cs
- IPAddressCollection.cs
- ElementHostPropertyMap.cs
- PartialClassGenerationTask.cs
- UserValidatedEventArgs.cs
- XmlSchemaSubstitutionGroup.cs
- GridView.cs
- AssociationProvider.cs
- LongValidator.cs
- Pens.cs
- ValueSerializer.cs
- RegexParser.cs
- SoapUnknownHeader.cs
- SqlXml.cs
- SurrogateSelector.cs
- CodeCatchClauseCollection.cs
- UsernameTokenFactoryCredential.cs
- CellParagraph.cs
- AddingNewEventArgs.cs
- ControlCollection.cs
- NestPullup.cs
- GlyphTypeface.cs
- TripleDES.cs
- StreamReader.cs
- LayoutEvent.cs
- ToolBar.cs
- OneToOneMappingSerializer.cs
- CaseInsensitiveHashCodeProvider.cs
- CustomPopupPlacement.cs
- EntityProviderServices.cs
- DataTableReader.cs
- PageAdapter.cs
- UTF8Encoding.cs
- AssemblySettingAttributes.cs
- TimeSpanStorage.cs
- WorkflowServiceBehavior.cs
- ClassHandlersStore.cs
- ReadOnlyObservableCollection.cs
- Int32Converter.cs
- SynchronizedInputHelper.cs
- TemplateBindingExpressionConverter.cs
- ContentIterators.cs
- EnumBuilder.cs
- MergeLocalizationDirectives.cs
- HttpProfileGroupBase.cs
- WorkflowView.cs
- Currency.cs
- BindingWorker.cs
- TabletDevice.cs
- ImageAttributes.cs
- ApplyImportsAction.cs
- TableItemProviderWrapper.cs
- PageAdapter.cs
- RankException.cs
- ConfigurationStrings.cs
- WinEventQueueItem.cs
- AstTree.cs
- WebPartConnectionsEventArgs.cs