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
- TreeNodeStyle.cs
- RepeaterItemEventArgs.cs
- SchemaTableOptionalColumn.cs
- FormatSettings.cs
- UnsafeNativeMethods.cs
- QilPatternFactory.cs
- SecureEnvironment.cs
- XdrBuilder.cs
- ErrorFormatter.cs
- ManipulationPivot.cs
- CodeTypeConstructor.cs
- RsaSecurityTokenParameters.cs
- SinglePageViewer.cs
- categoryentry.cs
- ResourceReferenceExpression.cs
- HttpsTransportElement.cs
- Size3DConverter.cs
- SessionStateSection.cs
- StateMachineHistory.cs
- Constraint.cs
- DataGridViewRowConverter.cs
- Aggregates.cs
- SoapMessage.cs
- ListViewUpdateEventArgs.cs
- Conditional.cs
- SHA256.cs
- ToolStripItemDataObject.cs
- Speller.cs
- XmlTextAttribute.cs
- DbConnectionInternal.cs
- OracleBinary.cs
- DbProviderSpecificTypePropertyAttribute.cs
- ScriptDescriptor.cs
- ImageSourceValueSerializer.cs
- OdbcConnectionStringbuilder.cs
- CompositeFontInfo.cs
- TTSVoice.cs
- EastAsianLunisolarCalendar.cs
- remotingproxy.cs
- Main.cs
- DataServiceQueryException.cs
- ByteStream.cs
- ImageFormatConverter.cs
- MaskedTextBox.cs
- TransformValueSerializer.cs
- ReflectTypeDescriptionProvider.cs
- ExpressionPrefixAttribute.cs
- SQLInt16Storage.cs
- Command.cs
- EncryptedPackageFilter.cs
- SafeBuffer.cs
- SoapObjectWriter.cs
- InkCanvasInnerCanvas.cs
- Int32CAMarshaler.cs
- Fonts.cs
- SystemSounds.cs
- Schema.cs
- KnownTypesHelper.cs
- AccessedThroughPropertyAttribute.cs
- Canonicalizers.cs
- EmptyEnumerator.cs
- TypeUnloadedException.cs
- SharedPersonalizationStateInfo.cs
- ObjectDataSourceDisposingEventArgs.cs
- DataSysAttribute.cs
- TailCallAnalyzer.cs
- ObjectParameterCollection.cs
- JsonServiceDocumentSerializer.cs
- DefaultEventAttribute.cs
- GridViewColumnCollectionChangedEventArgs.cs
- TypeToken.cs
- Crypto.cs
- CaseStatementSlot.cs
- DoubleCollection.cs
- CommandLibraryHelper.cs
- DoubleUtil.cs
- SqlBooleanizer.cs
- NullRuntimeConfig.cs
- MsmqActivation.cs
- ConnectionPoint.cs
- BitmapFrameDecode.cs
- Listbox.cs
- ScriptResourceHandler.cs
- ConfigXmlAttribute.cs
- WeakReadOnlyCollection.cs
- StreamSecurityUpgradeAcceptorBase.cs
- XmlBinaryReader.cs
- CheckableControlBaseAdapter.cs
- UrlSyndicationContent.cs
- X509Certificate2Collection.cs
- Activator.cs
- DockingAttribute.cs
- Unit.cs
- ConditionalAttribute.cs
- Tokenizer.cs
- BindingContext.cs
- ButtonBaseAutomationPeer.cs
- TargetFrameworkAttribute.cs
- ListParaClient.cs
- BufferedOutputStream.cs