Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / SMDiagnostics / System / ServiceModel / Diagnostics / MachineSettingsSection.cs / 1305376 / MachineSettingsSection.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.ServiceModel.Configuration { using System.Configuration; internal class MachineSettingsSection : ConfigurationSection { static bool enableLoggingKnownPii; static bool hasInitialized = false; static object syncRoot = new object(); const string enableLoggingKnownPiiKey = "enableLoggingKnownPii"; ConfigurationPropertyCollection properties; protected override ConfigurationPropertyCollection Properties { get { if (this.properties == null) { ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection(); properties.Add(new ConfigurationProperty(MachineSettingsSection.enableLoggingKnownPiiKey, typeof(System.Boolean), false, null, null, System.Configuration.ConfigurationPropertyOptions.None)); this.properties = properties; } return this.properties; } } public static bool EnableLoggingKnownPii { get { if (!hasInitialized) { lock (syncRoot) { if (!hasInitialized) { MachineSettingsSection machineSettingsSection = (MachineSettingsSection)ConfigurationManager.GetSection("system.serviceModel/machineSettings"); enableLoggingKnownPii = (bool)machineSettingsSection[MachineSettingsSection.enableLoggingKnownPiiKey]; hasInitialized = true; } } } return enableLoggingKnownPii; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.ServiceModel.Configuration { using System.Configuration; internal class MachineSettingsSection : ConfigurationSection { static bool enableLoggingKnownPii; static bool hasInitialized = false; static object syncRoot = new object(); const string enableLoggingKnownPiiKey = "enableLoggingKnownPii"; ConfigurationPropertyCollection properties; protected override ConfigurationPropertyCollection Properties { get { if (this.properties == null) { ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection(); properties.Add(new ConfigurationProperty(MachineSettingsSection.enableLoggingKnownPiiKey, typeof(System.Boolean), false, null, null, System.Configuration.ConfigurationPropertyOptions.None)); this.properties = properties; } return this.properties; } } public static bool EnableLoggingKnownPii { get { if (!hasInitialized) { lock (syncRoot) { if (!hasInitialized) { MachineSettingsSection machineSettingsSection = (MachineSettingsSection)ConfigurationManager.GetSection("system.serviceModel/machineSettings"); enableLoggingKnownPii = (bool)machineSettingsSection[MachineSettingsSection.enableLoggingKnownPiiKey]; hasInitialized = true; } } } return enableLoggingKnownPii; } } } } // 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
- FolderLevelBuildProvider.cs
- MediaTimeline.cs
- AdRotatorDesigner.cs
- PkcsMisc.cs
- SamlSubjectStatement.cs
- ResourceReader.cs
- Constraint.cs
- FixedDocumentSequencePaginator.cs
- LineInfo.cs
- LocatorGroup.cs
- LocatorPart.cs
- ProcessStartInfo.cs
- CookieHandler.cs
- PageContentCollection.cs
- WebBrowserNavigatedEventHandler.cs
- ObjectListCommandEventArgs.cs
- TimeEnumHelper.cs
- ComPlusDiagnosticTraceRecords.cs
- XmlSchemaImport.cs
- SafeFileMapViewHandle.cs
- ObjectDataSourceMethodEventArgs.cs
- ErrorHandlerModule.cs
- EncryptedReference.cs
- Point3DConverter.cs
- SettingsPropertyValue.cs
- CodeAttributeArgumentCollection.cs
- DescriptionAttribute.cs
- CheckBoxFlatAdapter.cs
- ClusterRegistryConfigurationProvider.cs
- DefaultTextStoreTextComposition.cs
- SqlDataReader.cs
- TypefaceMetricsCache.cs
- PrivilegeNotHeldException.cs
- CatalogPartCollection.cs
- RadioButtonStandardAdapter.cs
- AttachedAnnotation.cs
- XmlFormatWriterGenerator.cs
- SubtreeProcessor.cs
- XmlAtomErrorReader.cs
- MergeFilterQuery.cs
- XmlNodeReader.cs
- KeyBinding.cs
- HttpCachePolicyElement.cs
- XamlStream.cs
- Binding.cs
- HtmlInputCheckBox.cs
- TextStore.cs
- _SslStream.cs
- RawAppCommandInputReport.cs
- DependencyPropertyValueSerializer.cs
- ConnectionStringsExpressionBuilder.cs
- ISessionStateStore.cs
- DataColumnPropertyDescriptor.cs
- SystemIPInterfaceProperties.cs
- SymmetricKeyWrap.cs
- LocalIdKeyIdentifierClause.cs
- GeometryHitTestParameters.cs
- WebPartDisplayModeEventArgs.cs
- Content.cs
- DataGridViewRowHeaderCell.cs
- HttpPostedFile.cs
- RootBrowserWindowAutomationPeer.cs
- PassportAuthenticationEventArgs.cs
- TypedDataSourceCodeGenerator.cs
- MailAddress.cs
- WindowsListViewGroupHelper.cs
- Viewport2DVisual3D.cs
- DataGridViewImageColumn.cs
- TreeBuilder.cs
- DBAsyncResult.cs
- TypeNameParser.cs
- ServicePointManagerElement.cs
- QilReference.cs
- String.cs
- FontClient.cs
- TableLayoutStyleCollection.cs
- TextRange.cs
- SafeSecurityHandles.cs
- Version.cs
- CancelEventArgs.cs
- HttpCapabilitiesEvaluator.cs
- TextBoxDesigner.cs
- TimeZoneNotFoundException.cs
- IsolatedStorageFile.cs
- ProcessModelSection.cs
- TraceHandler.cs
- ExpressionParser.cs
- MarkupCompiler.cs
- AutomationPropertyInfo.cs
- NativeActivityTransactionContext.cs
- StorageEntityTypeMapping.cs
- BitmapEffectRenderDataResource.cs
- BitSet.cs
- HtmlTernaryTree.cs
- HTMLTagNameToTypeMapper.cs
- WindowsStatusBar.cs
- SeekStoryboard.cs
- DataContext.cs
- UntypedNullExpression.cs
- UpdatePanelControlTrigger.cs