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
- ObjectConverter.cs
- SafeIUnknown.cs
- RotateTransform3D.cs
- AnnotationStore.cs
- WebPartZone.cs
- StyleTypedPropertyAttribute.cs
- FunctionUpdateCommand.cs
- TextBox.cs
- Symbol.cs
- CodeNamespaceImport.cs
- DataGridViewRowConverter.cs
- CustomCategoryAttribute.cs
- RSAOAEPKeyExchangeDeformatter.cs
- MaskedTextBox.cs
- OracleEncoding.cs
- InheritanceContextChangedEventManager.cs
- CharacterString.cs
- ViewManager.cs
- ModuleBuilderData.cs
- XsdDateTime.cs
- HwndSubclass.cs
- DiagnosticsConfiguration.cs
- CapacityStreamGeometryContext.cs
- SafeViewOfFileHandle.cs
- ContravarianceAdapter.cs
- Constraint.cs
- BitmapEffectDrawing.cs
- HitTestWithPointDrawingContextWalker.cs
- ApplyImportsAction.cs
- DataGridViewSelectedRowCollection.cs
- InkCanvasSelection.cs
- ProviderConnectionPointCollection.cs
- WebPartEditVerb.cs
- MaskedTextProvider.cs
- Brush.cs
- FrameworkElement.cs
- SafeRightsManagementQueryHandle.cs
- WorkflowPersistenceService.cs
- DbMetaDataColumnNames.cs
- CustomUserNameSecurityTokenAuthenticator.cs
- OLEDB_Util.cs
- SqlError.cs
- Form.cs
- CheckBoxField.cs
- CompilerScopeManager.cs
- DataConnectionHelper.cs
- TreeNodeCollectionEditor.cs
- CursorConverter.cs
- Literal.cs
- ObjectCacheHost.cs
- KeyValuePairs.cs
- ObjectListCommandCollection.cs
- DataGridViewEditingControlShowingEventArgs.cs
- HtmlTableCell.cs
- SqlGatherConsumedAliases.cs
- TextSchema.cs
- XPathSelectionIterator.cs
- SerializationSectionGroup.cs
- IndexingContentUnit.cs
- RepeaterCommandEventArgs.cs
- OperationContractGenerationContext.cs
- View.cs
- MsmqInputMessagePool.cs
- FieldBuilder.cs
- OverrideMode.cs
- TrackBar.cs
- CompositeScriptReferenceEventArgs.cs
- FilteredSchemaElementLookUpTable.cs
- InstallerTypeAttribute.cs
- DesignTimeValidationFeature.cs
- WebPartManager.cs
- COM2PictureConverter.cs
- URLString.cs
- UIElement.cs
- XmlDocument.cs
- AssemblyFilter.cs
- AsmxEndpointPickerExtension.cs
- ConfigXmlElement.cs
- LicenseManager.cs
- ScrollBarRenderer.cs
- ListItem.cs
- FlowDocumentFormatter.cs
- WindowCollection.cs
- WebControlAdapter.cs
- TypeBuilderInstantiation.cs
- UInt16Converter.cs
- FormatterServices.cs
- RegisteredDisposeScript.cs
- NotImplementedException.cs
- XmlChoiceIdentifierAttribute.cs
- BaseDataList.cs
- ClipboardData.cs
- TypeForwardedToAttribute.cs
- SecureConversationSecurityTokenParameters.cs
- SafeSystemMetrics.cs
- MergablePropertyAttribute.cs
- MetafileHeader.cs
- StatusBarItem.cs
- X509SecurityTokenAuthenticator.cs
- GcSettings.cs