Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- EntityConnection.cs
- ContainerControl.cs
- TextMarkerSource.cs
- PathSegment.cs
- DataGridTextBox.cs
- ValidationPropertyAttribute.cs
- DocumentXPathNavigator.cs
- FixedTextView.cs
- ShaperBuffers.cs
- ByteFacetDescriptionElement.cs
- CounterSetInstance.cs
- TdsValueSetter.cs
- XslAstAnalyzer.cs
- PngBitmapDecoder.cs
- RouteItem.cs
- XMLSyntaxException.cs
- TableLayoutColumnStyleCollection.cs
- TokenizerHelper.cs
- CodeRemoveEventStatement.cs
- PropertyStore.cs
- ObfuscationAttribute.cs
- AudioLevelUpdatedEventArgs.cs
- ProgressBarHighlightConverter.cs
- DataGridViewCellParsingEventArgs.cs
- PropertyCollection.cs
- ZipIOBlockManager.cs
- AppPool.cs
- IncrementalHitTester.cs
- ExpressionConverter.cs
- NeutralResourcesLanguageAttribute.cs
- BindingCollection.cs
- Blend.cs
- LowerCaseStringConverter.cs
- EnumUnknown.cs
- DataTableReaderListener.cs
- XmlText.cs
- ExeContext.cs
- ResourceExpressionBuilder.cs
- RequiredAttributeAttribute.cs
- CatalogPartChrome.cs
- QilXmlReader.cs
- UriExt.cs
- EncodingDataItem.cs
- PlanCompiler.cs
- BinHexDecoder.cs
- RepeaterItem.cs
- RegexCapture.cs
- WebServiceErrorEvent.cs
- InternalsVisibleToAttribute.cs
- ReadWriteObjectLock.cs
- CodeCommentStatementCollection.cs
- ChannelRequirements.cs
- EventManager.cs
- OleDbFactory.cs
- BitmapImage.cs
- ListViewCommandEventArgs.cs
- InlineCollection.cs
- OdbcCommandBuilder.cs
- MinMaxParagraphWidth.cs
- ImageMap.cs
- FormDocumentDesigner.cs
- MenuItemStyleCollection.cs
- UnionCodeGroup.cs
- ControlFilterExpression.cs
- ImmComposition.cs
- XmlSchema.cs
- MailBnfHelper.cs
- CommonProperties.cs
- GenericEnumConverter.cs
- TypeDescriptionProviderAttribute.cs
- ControlCollection.cs
- ObjectAnimationBase.cs
- AgileSafeNativeMemoryHandle.cs
- TypeUtil.cs
- CodeSnippetTypeMember.cs
- RegexFCD.cs
- DefaultMemberAttribute.cs
- TextDecorationLocationValidation.cs
- AbstractExpressions.cs
- QueryCacheEntry.cs
- ObjectRef.cs
- GenerateScriptTypeAttribute.cs
- SqlStream.cs
- ColorInterpolationModeValidation.cs
- EntityContainerRelationshipSetEnd.cs
- PenThreadPool.cs
- ListControl.cs
- DetectRunnableInstancesTask.cs
- ExceptionTranslationTable.cs
- WindowsFormsSectionHandler.cs
- SystemKeyConverter.cs
- ToolStripDropDownClosingEventArgs.cs
- DropShadowEffect.cs
- StateDesigner.TransitionInfo.cs
- BulletedListEventArgs.cs
- CaseExpr.cs
- _NativeSSPI.cs
- Metafile.cs
- EmptyControlCollection.cs
- Visual3D.cs