Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / CompMod / System / Diagnostics / SourceSwitch.cs / 1 / SourceSwitch.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- using System; using System.Collections; using System.Collections.Specialized; using System.Threading; using System.Security; using System.Security.Permissions; namespace System.Diagnostics { public class SourceSwitch : Switch { public SourceSwitch(string name) : base(name, String.Empty) {} public SourceSwitch(string displayName, string defaultSwitchValue) : base(displayName, String.Empty, defaultSwitchValue) { } public SourceLevels Level { get { return (SourceLevels) SwitchSetting; } [SecurityPermission(SecurityAction.LinkDemand, Flags=SecurityPermissionFlag.UnmanagedCode)] set { SwitchSetting = (int) value; } } public bool ShouldTrace(TraceEventType eventType) { return (SwitchSetting & (int) eventType) != 0; } protected override void OnValueChanged() { SwitchSetting = (int) Enum.Parse(typeof(SourceLevels), Value, true); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- using System; using System.Collections; using System.Collections.Specialized; using System.Threading; using System.Security; using System.Security.Permissions; namespace System.Diagnostics { public class SourceSwitch : Switch { public SourceSwitch(string name) : base(name, String.Empty) {} public SourceSwitch(string displayName, string defaultSwitchValue) : base(displayName, String.Empty, defaultSwitchValue) { } public SourceLevels Level { get { return (SourceLevels) SwitchSetting; } [SecurityPermission(SecurityAction.LinkDemand, Flags=SecurityPermissionFlag.UnmanagedCode)] set { SwitchSetting = (int) value; } } public bool ShouldTrace(TraceEventType eventType) { return (SwitchSetting & (int) eventType) != 0; } protected override void OnValueChanged() { SwitchSetting = (int) Enum.Parse(typeof(SourceLevels), Value, true); } } } // 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
- ReferencedType.cs
- NativeDirectoryServicesQueryAPIs.cs
- XmlEntity.cs
- EventDescriptor.cs
- MailSettingsSection.cs
- MinimizableAttributeTypeConverter.cs
- RegisteredScript.cs
- EdmError.cs
- FixedDocumentPaginator.cs
- XmlIncludeAttribute.cs
- XsltInput.cs
- StrongNameHelpers.cs
- HttpModuleCollection.cs
- PositiveTimeSpanValidator.cs
- ErrorFormatterPage.cs
- ConfigurationErrorsException.cs
- NativeMethods.cs
- WSUtilitySpecificationVersion.cs
- MediaElement.cs
- DataFormat.cs
- Maps.cs
- TextDecorationLocationValidation.cs
- ExtendedProtectionPolicyElement.cs
- DataGridViewComponentPropertyGridSite.cs
- InkPresenter.cs
- RegexCompiler.cs
- IndicShape.cs
- InstanceNameConverter.cs
- CapabilitiesRule.cs
- StrokeNodeOperations2.cs
- MetadataArtifactLoaderComposite.cs
- GroupPartitionExpr.cs
- StylusPointProperties.cs
- SoapExtensionImporter.cs
- SqlHelper.cs
- Win32PrintDialog.cs
- ParameterExpression.cs
- CodeArrayIndexerExpression.cs
- ComplexObject.cs
- SingleStorage.cs
- ComponentDispatcher.cs
- PrePrepareMethodAttribute.cs
- MultiBindingExpression.cs
- SoapBinding.cs
- PtsCache.cs
- XmlSchemaObject.cs
- ResourcesGenerator.cs
- ExtensionDataObject.cs
- WebRequest.cs
- QilInvokeLateBound.cs
- SecureConversationSecurityTokenParameters.cs
- FieldTemplateFactory.cs
- Debug.cs
- RawMouseInputReport.cs
- XmlDataSourceView.cs
- TakeOrSkipWhileQueryOperator.cs
- StateManager.cs
- C14NUtil.cs
- UnsettableComboBox.cs
- DataGridColumnReorderingEventArgs.cs
- Span.cs
- SqlCommand.cs
- LocalValueEnumerator.cs
- ScriptResourceMapping.cs
- formatter.cs
- StyleCollection.cs
- NeutralResourcesLanguageAttribute.cs
- AppDomainProtocolHandler.cs
- GenericTypeParameterBuilder.cs
- ControlIdConverter.cs
- TextLineBreak.cs
- DesignerPerfEventProvider.cs
- CompressionTransform.cs
- _CookieModule.cs
- InfoCardRSAPKCS1SignatureDeformatter.cs
- FileSystemInfo.cs
- DeploymentSectionCache.cs
- StreamGeometryContext.cs
- BufferedResponseStream.cs
- FileDialogPermission.cs
- Timer.cs
- EraserBehavior.cs
- WebScriptServiceHost.cs
- EditingCoordinator.cs
- PrtTicket_Public.cs
- XmlSchemaDatatype.cs
- MessageSmuggler.cs
- HttpStreamXmlDictionaryReader.cs
- GroupBoxAutomationPeer.cs
- AssemblyAttributesGoHere.cs
- counter.cs
- AddressHeader.cs
- DeviceFiltersSection.cs
- RepeaterDataBoundAdapter.cs
- RijndaelManaged.cs
- UnmanagedMarshal.cs
- AccessKeyManager.cs
- StrokeFIndices.cs
- PartialTrustVisibleAssemblyCollection.cs
- FileAuthorizationModule.cs