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
- FormatterServicesNoSerializableCheck.cs
- ParserStreamGeometryContext.cs
- SmiGettersStream.cs
- ContainerSelectorBehavior.cs
- EncoderFallback.cs
- SystemNetworkInterface.cs
- MediaPlayer.cs
- ObservableDictionary.cs
- XmlWellformedWriter.cs
- ScriptReferenceEventArgs.cs
- Component.cs
- DataGridViewIntLinkedList.cs
- UnsafeNativeMethods.cs
- TextPattern.cs
- CharacterBuffer.cs
- SrgsSubset.cs
- GCHandleCookieTable.cs
- PositiveTimeSpanValidatorAttribute.cs
- SqlParameterCollection.cs
- EdmSchemaAttribute.cs
- _ConnectOverlappedAsyncResult.cs
- MobileUITypeEditor.cs
- XPathEmptyIterator.cs
- CompositeFontParser.cs
- AQNBuilder.cs
- DataFormat.cs
- SplashScreen.cs
- StatusBar.cs
- EntitySqlQueryCacheEntry.cs
- WebPartsSection.cs
- ParserStreamGeometryContext.cs
- HeaderedItemsControl.cs
- MainMenu.cs
- EnumerationRangeValidationUtil.cs
- MSHTMLHostUtil.cs
- COM2ColorConverter.cs
- DataGridPagerStyle.cs
- XmlCodeExporter.cs
- ControlAdapter.cs
- PointHitTestParameters.cs
- AnimationClock.cs
- FixedSOMPageElement.cs
- RC2.cs
- BindingGroup.cs
- TypeBuilder.cs
- ApplicationFileCodeDomTreeGenerator.cs
- IndicShape.cs
- CircleHotSpot.cs
- ParenthesizePropertyNameAttribute.cs
- GeneralTransform.cs
- AttributeData.cs
- ExpandCollapsePattern.cs
- BitmapImage.cs
- PageParserFilter.cs
- DataGridViewRowCollection.cs
- SerializationEventsCache.cs
- FatalException.cs
- InvokePattern.cs
- diagnosticsswitches.cs
- PTManager.cs
- SudsWriter.cs
- ProxyManager.cs
- DataServiceStreamProviderWrapper.cs
- UITypeEditor.cs
- AccessDataSource.cs
- TableDetailsRow.cs
- Condition.cs
- FloaterParaClient.cs
- StylusLogic.cs
- XmlWriterSettings.cs
- SmtpException.cs
- ImageFormat.cs
- _NativeSSPI.cs
- CharAnimationBase.cs
- HtmlInputCheckBox.cs
- DrawingAttributesDefaultValueFactory.cs
- Point.cs
- OracleRowUpdatingEventArgs.cs
- TreeNodeMouseHoverEvent.cs
- IisTraceWebEventProvider.cs
- CombinedTcpChannel.cs
- HwndAppCommandInputProvider.cs
- OleDbDataReader.cs
- TableCell.cs
- PrincipalPermission.cs
- DictionaryEntry.cs
- TreeIterator.cs
- Config.cs
- DatePickerTextBox.cs
- UidManager.cs
- Function.cs
- BlurEffect.cs
- SQLInt32.cs
- DataControlLinkButton.cs
- AlternateViewCollection.cs
- ServicePointManagerElement.cs
- LazyTextWriterCreator.cs
- UTF8Encoding.cs
- KernelTypeValidation.cs
- SmtpFailedRecipientException.cs