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
- FixedDocument.cs
- SafeWaitHandle.cs
- SelectorAutomationPeer.cs
- PackageRelationshipCollection.cs
- FixedSOMFixedBlock.cs
- DockingAttribute.cs
- CodeAttachEventStatement.cs
- ThreadStateException.cs
- CompilerResults.cs
- ReaderOutput.cs
- FileRecordSequenceHelper.cs
- CharacterMetricsDictionary.cs
- ListViewCommandEventArgs.cs
- Attributes.cs
- ComponentCommands.cs
- RelatedPropertyManager.cs
- DesignerRegion.cs
- FileVersion.cs
- CommandTreeTypeHelper.cs
- ExpressionEditorAttribute.cs
- EmptyEnumerator.cs
- StatusBar.cs
- CategoryEditor.cs
- documentsequencetextpointer.cs
- XmlDataSource.cs
- ExecutionEngineException.cs
- LinkUtilities.cs
- TypefaceMetricsCache.cs
- CollectionBase.cs
- SerializationFieldInfo.cs
- StateWorkerRequest.cs
- RegistrationServices.cs
- Control.cs
- InputMethodStateTypeInfo.cs
- OdbcErrorCollection.cs
- BaseProcessProtocolHandler.cs
- ModelTreeEnumerator.cs
- ObjectAnimationBase.cs
- OdbcRowUpdatingEvent.cs
- BinaryParser.cs
- TimelineGroup.cs
- EventMappingSettings.cs
- PropertyValue.cs
- CompiledQueryCacheKey.cs
- EntityContainerRelationshipSetEnd.cs
- OperationExecutionFault.cs
- ServerValidateEventArgs.cs
- ColumnTypeConverter.cs
- Transaction.cs
- HwndProxyElementProvider.cs
- KeyConverter.cs
- AnnotationMap.cs
- PcmConverter.cs
- BindToObject.cs
- PenContexts.cs
- ListMarkerLine.cs
- XmlSchemaIdentityConstraint.cs
- SendMailErrorEventArgs.cs
- CacheMemory.cs
- TextServicesCompartment.cs
- StrongTypingException.cs
- CharacterMetrics.cs
- Debug.cs
- UiaCoreApi.cs
- CryptoProvider.cs
- SessionEndedEventArgs.cs
- BoundingRectTracker.cs
- ModelItemCollectionImpl.cs
- ProxyHwnd.cs
- RichTextBox.cs
- XmlSchemaIdentityConstraint.cs
- BaseResourcesBuildProvider.cs
- DataGrid.cs
- EventToken.cs
- DataGridViewRowHeightInfoNeededEventArgs.cs
- DataViewManager.cs
- FragmentQuery.cs
- WebPartDescription.cs
- DefaultPropertyAttribute.cs
- UnsafeNativeMethods.cs
- ExternalException.cs
- WindowsNonControl.cs
- DiagnosticStrings.cs
- GridSplitterAutomationPeer.cs
- MediaElementAutomationPeer.cs
- CharConverter.cs
- ContainerParaClient.cs
- WSUtilitySpecificationVersion.cs
- BaseCodePageEncoding.cs
- NativeRightsManagementAPIsStructures.cs
- FlowLayoutPanelDesigner.cs
- ButtonBaseAutomationPeer.cs
- ToolBarButtonClickEvent.cs
- SizeLimitedCache.cs
- PageThemeBuildProvider.cs
- SHA1.cs
- PeerApplication.cs
- TraceContext.cs
- RectAnimationBase.cs
- WebHttpBindingCollectionElement.cs