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
- RowSpanVector.cs
- HtmlTableCellCollection.cs
- UIElement.cs
- SQLMoney.cs
- ForeignKeyConstraint.cs
- InvalidComObjectException.cs
- _BufferOffsetSize.cs
- PersonalizationStateQuery.cs
- MimeWriter.cs
- XappLauncher.cs
- DbFunctionCommandTree.cs
- FormViewInsertedEventArgs.cs
- XmlSchemaRedefine.cs
- ComplexPropertyEntry.cs
- DataControlField.cs
- Version.cs
- Profiler.cs
- SynchronizationLockException.cs
- UniqueConstraint.cs
- CheckBoxFlatAdapter.cs
- AgileSafeNativeMemoryHandle.cs
- HtmlButton.cs
- DBSqlParserTable.cs
- WmpBitmapEncoder.cs
- DataGridViewCellCancelEventArgs.cs
- LicenseManager.cs
- Graphics.cs
- DependencySource.cs
- UserPersonalizationStateInfo.cs
- ISAPIRuntime.cs
- SecurityStandardsManager.cs
- XmlWrappingReader.cs
- Container.cs
- FileSystemEventArgs.cs
- SettingsProviderCollection.cs
- JsonDeserializer.cs
- HostedHttpContext.cs
- ConfigXmlElement.cs
- ListMarkerSourceInfo.cs
- SmiEventStream.cs
- MatrixTransform.cs
- CodeAttachEventStatement.cs
- Wizard.cs
- AlignmentXValidation.cs
- ToolboxItemFilterAttribute.cs
- VisualTransition.cs
- SendKeys.cs
- RotateTransform3D.cs
- BitmapPalette.cs
- SelectedDatesCollection.cs
- AttributeAction.cs
- EmbossBitmapEffect.cs
- XmlSchemaType.cs
- ParserStack.cs
- FileDetails.cs
- HttpResponse.cs
- IdentifierCreationService.cs
- FirstMatchCodeGroup.cs
- RawTextInputReport.cs
- SparseMemoryStream.cs
- SessionPageStatePersister.cs
- GrammarBuilder.cs
- HtmlHistory.cs
- QilGenerator.cs
- DataGridPageChangedEventArgs.cs
- DataSourceHelper.cs
- RestClientProxyHandler.cs
- safesecurityhelperavalon.cs
- LateBoundBitmapDecoder.cs
- XmlDocumentSurrogate.cs
- ArraySortHelper.cs
- InvokeBase.cs
- PowerModeChangedEventArgs.cs
- ParamArrayAttribute.cs
- ListItem.cs
- Int32CollectionConverter.cs
- DetailsViewDeleteEventArgs.cs
- Empty.cs
- GlyphInfoList.cs
- UpWmlMobileTextWriter.cs
- DetailsViewModeEventArgs.cs
- ReceiveMessageContent.cs
- TriggerActionCollection.cs
- GlyphCollection.cs
- SymbolDocumentGenerator.cs
- CheckBoxStandardAdapter.cs
- CodeAssignStatement.cs
- ObjectCloneHelper.cs
- ToolStripRenderEventArgs.cs
- DivideByZeroException.cs
- WorkflowDefinitionDispenser.cs
- codemethodreferenceexpression.cs
- SequenceDesignerAccessibleObject.cs
- HeaderFilter.cs
- PerformanceCountersElement.cs
- XPathDocumentIterator.cs
- BasicKeyConstraint.cs
- ReferencedType.cs
- XmlDictionaryWriter.cs
- InOutArgument.cs