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
- _FtpDataStream.cs
- FloaterParaClient.cs
- CounterSampleCalculator.cs
- DynamicEndpointElement.cs
- NonParentingControl.cs
- TransformValueSerializer.cs
- EditorPartCollection.cs
- SecureEnvironment.cs
- PropertyCollection.cs
- CellLabel.cs
- StringWriter.cs
- TlsnegoTokenAuthenticator.cs
- EmptyElement.cs
- XmlSchemaRedefine.cs
- DetailsViewInsertedEventArgs.cs
- ForceCopyBuildProvider.cs
- CharAnimationUsingKeyFrames.cs
- EditCommandColumn.cs
- CompilerWrapper.cs
- LineVisual.cs
- FixUp.cs
- DataServiceQueryException.cs
- LinkedList.cs
- FixedLineResult.cs
- ListSourceHelper.cs
- StatusBarDrawItemEvent.cs
- InstanceDataCollection.cs
- TextEditorLists.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- WebServiceReceiveDesigner.cs
- _SslSessionsCache.cs
- WorkflowInstanceExtensionProvider.cs
- OneOfScalarConst.cs
- RegexCompiler.cs
- LexicalChunk.cs
- DataContractAttribute.cs
- ToolStripDropTargetManager.cs
- IPEndPoint.cs
- GroupLabel.cs
- DetailsViewRow.cs
- DataConnectionHelper.cs
- ErrorFormatterPage.cs
- BuildProviderCollection.cs
- SafeThreadHandle.cs
- DbReferenceCollection.cs
- TextDecorationLocationValidation.cs
- Comparer.cs
- FlowDocumentFormatter.cs
- TemplateBindingExtension.cs
- SByteConverter.cs
- InternalResources.cs
- PathTooLongException.cs
- SqlRowUpdatedEvent.cs
- ControlPropertyNameConverter.cs
- SafeCryptoHandles.cs
- DataSourceDesigner.cs
- TextClipboardData.cs
- DispatcherEventArgs.cs
- SerTrace.cs
- TypedCompletedAsyncResult.cs
- AccessViolationException.cs
- _FtpDataStream.cs
- SchemaAttDef.cs
- SchemaDeclBase.cs
- Viewport2DVisual3D.cs
- WinFormsUtils.cs
- TraceLevelStore.cs
- EventLogEntry.cs
- DecoratedNameAttribute.cs
- TemplateControlBuildProvider.cs
- AbstractDataSvcMapFileLoader.cs
- OutputCacheProfile.cs
- FigureHelper.cs
- remotingproxy.cs
- StylusLogic.cs
- AuthenticationModuleElementCollection.cs
- FocusChangedEventArgs.cs
- SerialStream.cs
- SaveFileDialogDesigner.cs
- HwndSourceParameters.cs
- CompressStream.cs
- SpecialFolderEnumConverter.cs
- HostingEnvironment.cs
- ConsumerConnectionPoint.cs
- basecomparevalidator.cs
- FrugalMap.cs
- SafeHandle.cs
- OuterGlowBitmapEffect.cs
- TypeUnloadedException.cs
- DCSafeHandle.cs
- StrokeSerializer.cs
- _HeaderInfo.cs
- XmlSchemaInclude.cs
- SeekableReadStream.cs
- EdmItemCollection.OcAssemblyCache.cs
- returneventsaver.cs
- Collection.cs
- TypeSystem.cs
- ItemCollection.cs
- IndentedWriter.cs