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
- ItemList.cs
- LowerCaseStringConverter.cs
- MailWriter.cs
- GenericEnumerator.cs
- DataGridViewCellCollection.cs
- ClientData.cs
- _Events.cs
- CompressEmulationStream.cs
- HttpContextWrapper.cs
- EdmFunction.cs
- RootProfilePropertySettingsCollection.cs
- ZipIOFileItemStream.cs
- ToolStripItem.cs
- ValidationErrorCollection.cs
- CompModSwitches.cs
- WizardPanelChangingEventArgs.cs
- XmlWrappingReader.cs
- WinFormsUtils.cs
- RC2.cs
- CodeDirectionExpression.cs
- SerialPinChanges.cs
- GPRECTF.cs
- RelationshipConstraintValidator.cs
- MILUtilities.cs
- Relationship.cs
- RawStylusSystemGestureInputReport.cs
- ProbeMatchesCD1.cs
- ParentUndoUnit.cs
- StreamingContext.cs
- ConfigXmlWhitespace.cs
- HelpProvider.cs
- CharacterShapingProperties.cs
- DataGridParentRows.cs
- XLinq.cs
- SqlComparer.cs
- XmlElementCollection.cs
- CodeIdentifiers.cs
- CompoundFileReference.cs
- SecureStringHasher.cs
- Exceptions.cs
- OutputCacheSettingsSection.cs
- KeyManager.cs
- GB18030Encoding.cs
- EventInfo.cs
- QueryLifecycle.cs
- HebrewCalendar.cs
- DataObjectCopyingEventArgs.cs
- DynamicDataManager.cs
- Label.cs
- XmlSchemaInclude.cs
- SqlBuilder.cs
- TypeDescriptionProvider.cs
- ObjectDesignerDataSourceView.cs
- SecurityManager.cs
- TextViewBase.cs
- SpeechRecognizer.cs
- AnimationClock.cs
- SizeChangedEventArgs.cs
- DesignerAdRotatorAdapter.cs
- DataSet.cs
- InternalResources.cs
- GenericEnumConverter.cs
- ThemeDirectoryCompiler.cs
- ColorConvertedBitmap.cs
- EventArgs.cs
- HttpVersion.cs
- BamlLocalizableResourceKey.cs
- webproxy.cs
- FileNotFoundException.cs
- TextFormatterImp.cs
- AssociationTypeEmitter.cs
- ExpressionBindingCollection.cs
- MemberCollection.cs
- RightsManagementEncryptedStream.cs
- DataMemberListEditor.cs
- PerformanceCounterManager.cs
- CqlLexerHelpers.cs
- SchemaHelper.cs
- AssemblyInfo.cs
- TypeConverterAttribute.cs
- UriTemplateTrieLocation.cs
- FileFormatException.cs
- XmlSerializationWriter.cs
- OSFeature.cs
- DbProviderFactoriesConfigurationHandler.cs
- XPathNodeInfoAtom.cs
- _CookieModule.cs
- HandoffBehavior.cs
- DataServiceEntityAttribute.cs
- mediaclock.cs
- TreeNode.cs
- WinEventHandler.cs
- TransformerTypeCollection.cs
- CompilerScope.cs
- InputBindingCollection.cs
- PolyQuadraticBezierSegment.cs
- Matrix3DConverter.cs
- RelationshipConverter.cs
- Win32SafeHandles.cs
- TypographyProperties.cs