Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- Setter.cs
- VectorCollectionConverter.cs
- ExternalException.cs
- RemoveStoryboard.cs
- SlipBehavior.cs
- PlatformCulture.cs
- DropDownHolder.cs
- EndpointIdentityConverter.cs
- TextViewSelectionProcessor.cs
- RijndaelManagedTransform.cs
- StreamUpdate.cs
- StorageTypeMapping.cs
- SmtpDigestAuthenticationModule.cs
- FlowNode.cs
- DBCommandBuilder.cs
- WebPageTraceListener.cs
- DocumentViewerHelper.cs
- _NegotiateClient.cs
- GeneralTransformCollection.cs
- RepeaterItemCollection.cs
- ConfigXmlWhitespace.cs
- HtmlInputImage.cs
- Validator.cs
- XmlSchemaGroupRef.cs
- IProducerConsumerCollection.cs
- LocatorBase.cs
- GeneralTransformGroup.cs
- EventProviderWriter.cs
- XamlLoadErrorInfo.cs
- _DisconnectOverlappedAsyncResult.cs
- Journaling.cs
- RemotingServices.cs
- WindowsScroll.cs
- UIPropertyMetadata.cs
- UpdateTranslator.cs
- Compilation.cs
- ParenthesizePropertyNameAttribute.cs
- DataService.cs
- OutOfProcStateClientManager.cs
- DBCommand.cs
- SystemWebSectionGroup.cs
- Deflater.cs
- RenderData.cs
- JoinGraph.cs
- ToolStripDropDownItem.cs
- FlowPosition.cs
- ApplicationSecurityManager.cs
- DataGridViewCellValidatingEventArgs.cs
- HttpPostedFile.cs
- RectangleConverter.cs
- MasterPageBuildProvider.cs
- MethodSignatureGenerator.cs
- EventLogPermissionEntryCollection.cs
- TemplateBindingExtension.cs
- ContentTextAutomationPeer.cs
- MenuItem.cs
- OptionUsage.cs
- oledbmetadatacollectionnames.cs
- ListViewContainer.cs
- ExpressionList.cs
- TargetConverter.cs
- PolicyValidationException.cs
- Fonts.cs
- ErrorWrapper.cs
- HttpClientCertificate.cs
- TdsRecordBufferSetter.cs
- OlePropertyStructs.cs
- NavigationPropertyEmitter.cs
- EventDescriptorCollection.cs
- HtmlHistory.cs
- FileLogRecord.cs
- PowerStatus.cs
- SchemaConstraints.cs
- SpeechUI.cs
- MessageSmuggler.cs
- FactoryGenerator.cs
- DataViewManager.cs
- AdapterUtil.cs
- SecurityKeyIdentifier.cs
- ProcessHostConfigUtils.cs
- DataSourceGeneratorException.cs
- StylusCollection.cs
- MenuBindingsEditorForm.cs
- TableHeaderCell.cs
- ItemDragEvent.cs
- ParseElement.cs
- OpCopier.cs
- Transform.cs
- ImageMapEventArgs.cs
- SqlTrackingService.cs
- OleDbCommand.cs
- FilteredDataSetHelper.cs
- SoapAttributeOverrides.cs
- MemberDescriptor.cs
- UInt16Converter.cs
- DecoderNLS.cs
- SystemIcmpV4Statistics.cs
- OleServicesContext.cs
- ComponentChangingEvent.cs
- MsmqIntegrationSecurityMode.cs