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
- DataGridAutoFormat.cs
- ToolStripItemTextRenderEventArgs.cs
- IntSecurity.cs
- HandlerFactoryWrapper.cs
- ProxyHelper.cs
- FontFamilyIdentifier.cs
- messageonlyhwndwrapper.cs
- xmlsaver.cs
- EmptyStringExpandableObjectConverter.cs
- NullNotAllowedCollection.cs
- ObjectComplexPropertyMapping.cs
- ReflectionTypeLoadException.cs
- TraceSource.cs
- ObjectPersistData.cs
- TransactionsSectionGroup.cs
- DbMetaDataColumnNames.cs
- ImageSourceConverter.cs
- Missing.cs
- TrackingProfileSerializer.cs
- MenuItemCollection.cs
- WindowsSolidBrush.cs
- EventSinkHelperWriter.cs
- LinkedList.cs
- ScrollBarRenderer.cs
- ExpandCollapsePatternIdentifiers.cs
- DataBindingList.cs
- WebHttpBindingCollectionElement.cs
- _LocalDataStore.cs
- TemplateParser.cs
- AsymmetricCryptoHandle.cs
- SoapTypeAttribute.cs
- Cell.cs
- Dictionary.cs
- RC2CryptoServiceProvider.cs
- ListSourceHelper.cs
- QuotedStringFormatReader.cs
- XPathSelectionIterator.cs
- XmlHierarchicalDataSourceView.cs
- SqlBinder.cs
- BindingManagerDataErrorEventArgs.cs
- FormViewInsertEventArgs.cs
- CookieHandler.cs
- BindingRestrictions.cs
- RegexInterpreter.cs
- OledbConnectionStringbuilder.cs
- DataViewListener.cs
- DetailsViewPageEventArgs.cs
- KeyValuePairs.cs
- GenericTypeParameterConverter.cs
- RuleInfoComparer.cs
- CaseInsensitiveHashCodeProvider.cs
- XmlILStorageConverter.cs
- RangeValuePatternIdentifiers.cs
- CharacterMetrics.cs
- ScalarRestriction.cs
- HostProtectionPermission.cs
- EnumerableCollectionView.cs
- PermissionRequestEvidence.cs
- DecoderNLS.cs
- UriTemplatePathSegment.cs
- ElementProxy.cs
- TextProviderWrapper.cs
- Matrix3DStack.cs
- ZipIOLocalFileHeader.cs
- SecurityDocument.cs
- MouseEvent.cs
- BindingListCollectionView.cs
- MarkupWriter.cs
- SvcMapFileSerializer.cs
- SelectedCellsChangedEventArgs.cs
- StructuralType.cs
- Int16KeyFrameCollection.cs
- AssemblyHash.cs
- CharEntityEncoderFallback.cs
- ResXBuildProvider.cs
- EncodingNLS.cs
- HScrollProperties.cs
- WmlImageAdapter.cs
- TouchFrameEventArgs.cs
- ScaleTransform3D.cs
- SparseMemoryStream.cs
- XmlCustomFormatter.cs
- HtmlInputReset.cs
- Rotation3D.cs
- InputGestureCollection.cs
- UrlPath.cs
- CodeDomDecompiler.cs
- BulletDecorator.cs
- DocumentPageView.cs
- GridToolTip.cs
- ListItemCollection.cs
- DetailsView.cs
- CounterCreationDataCollection.cs
- ResourceAssociationTypeEnd.cs
- SHA256Cng.cs
- Rect.cs
- CodeDirectoryCompiler.cs
- ExpressionBuilder.cs
- SecurityManager.cs
- HttpContext.cs