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
- StackSpiller.cs
- EventsTab.cs
- FixedSOMContainer.cs
- SourceInterpreter.cs
- Calendar.cs
- LinkLabelLinkClickedEvent.cs
- DbXmlEnabledProviderManifest.cs
- SerializerWriterEventHandlers.cs
- TableHeaderCell.cs
- ColumnCollection.cs
- RightsManagementPermission.cs
- UrlPath.cs
- KeyValuePairs.cs
- RelationshipEndMember.cs
- SqlInfoMessageEvent.cs
- CodePageEncoding.cs
- DataGridViewColumnCollection.cs
- ActivityExecutorSurrogate.cs
- GlyphRunDrawing.cs
- PeerDuplexChannelListener.cs
- PropertyValue.cs
- ProfileServiceManager.cs
- TemplateEditingVerb.cs
- FormClosedEvent.cs
- BroadcastEventHelper.cs
- PropertyCondition.cs
- Classification.cs
- CancellationHandler.cs
- TextTreeInsertUndoUnit.cs
- RadioButton.cs
- ProtocolViolationException.cs
- TypeElement.cs
- ParameterBuilder.cs
- XPathNodeInfoAtom.cs
- SqlTriggerAttribute.cs
- FirstQueryOperator.cs
- ServiceX509SecurityTokenProvider.cs
- SystemNetHelpers.cs
- FieldNameLookup.cs
- GroupPartitionExpr.cs
- FlowLayoutSettings.cs
- TextEndOfSegment.cs
- AuthorizationRule.cs
- StorageEndPropertyMapping.cs
- Drawing.cs
- CellTreeNodeVisitors.cs
- JumpList.cs
- SystemIPGlobalProperties.cs
- StateBag.cs
- LayoutInformation.cs
- HtmlWindow.cs
- PersistenceException.cs
- NodeFunctions.cs
- OptimisticConcurrencyException.cs
- SoapExtensionStream.cs
- XmlHelper.cs
- SystemInfo.cs
- PeerResolverElement.cs
- XmlSchemaSimpleContent.cs
- SvcMapFile.cs
- ListViewSortEventArgs.cs
- HtmlInputRadioButton.cs
- InternalEnumValidator.cs
- EditorPartCollection.cs
- SafeEventLogWriteHandle.cs
- ConvertersCollection.cs
- GeneralTransformCollection.cs
- Run.cs
- Pair.cs
- GroupBoxAutomationPeer.cs
- ServerValidateEventArgs.cs
- MetadataException.cs
- ColumnMapCopier.cs
- SqlDataSourceCustomCommandPanel.cs
- Subtract.cs
- QuaternionValueSerializer.cs
- SQLBytes.cs
- IdentifierService.cs
- XmlNodeList.cs
- ActivityTypeCodeDomSerializer.cs
- GridViewEditEventArgs.cs
- JsonServiceDocumentSerializer.cs
- InnerItemCollectionView.cs
- DefaultEventAttribute.cs
- InternalControlCollection.cs
- SqlBinder.cs
- MDIClient.cs
- HtmlElementErrorEventArgs.cs
- PersonalizationProvider.cs
- MetricEntry.cs
- HelpOperationInvoker.cs
- CatalogZone.cs
- DataContractSerializer.cs
- DescriptionAttribute.cs
- ConfigurationSectionCollection.cs
- StickyNoteAnnotations.cs
- PointHitTestParameters.cs
- StructuredProperty.cs
- AutomationElementCollection.cs