Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / 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);
}
}
}
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DataServiceQuery.cs
- SQLMoneyStorage.cs
- TextServicesLoader.cs
- Grid.cs
- RowTypeElement.cs
- CheckBox.cs
- PageTrueTypeFont.cs
- IProducerConsumerCollection.cs
- FormsAuthenticationModule.cs
- ProfilePropertyMetadata.cs
- LongValidatorAttribute.cs
- PageAsyncTask.cs
- SqlErrorCollection.cs
- StylusPoint.cs
- CompositeTypefaceMetrics.cs
- StickyNote.cs
- FlowSwitchLink.cs
- UnicastIPAddressInformationCollection.cs
- XComponentModel.cs
- OdbcReferenceCollection.cs
- TableLayoutRowStyleCollection.cs
- EllipseGeometry.cs
- DBBindings.cs
- Nullable.cs
- TdsParserStaticMethods.cs
- XhtmlBasicLabelAdapter.cs
- Viewport3DVisual.cs
- MonitoringDescriptionAttribute.cs
- ValidatorCompatibilityHelper.cs
- LiteralTextParser.cs
- AssertSection.cs
- XPathMessageFilter.cs
- LassoSelectionBehavior.cs
- PageBreakRecord.cs
- EntityParameterCollection.cs
- DataGridBoolColumn.cs
- CodeCommentStatement.cs
- OutputCacheProfileCollection.cs
- MsmqInputChannel.cs
- StartFileNameEditor.cs
- CounterCreationData.cs
- MetadataArtifactLoaderCompositeResource.cs
- ResourceDictionaryCollection.cs
- RemoveStoryboard.cs
- TargetParameterCountException.cs
- TextOnlyOutput.cs
- WinFormsSecurity.cs
- _ProxyChain.cs
- PropertyEmitter.cs
- CryptoHandle.cs
- NamespaceEmitter.cs
- ReferencedAssembly.cs
- ObfuscateAssemblyAttribute.cs
- HotCommands.cs
- WasNotInstalledException.cs
- ObjectDataSourceStatusEventArgs.cs
- GeneralTransform3D.cs
- OutOfMemoryException.cs
- WeakReadOnlyCollection.cs
- NonBatchDirectoryCompiler.cs
- bidPrivateBase.cs
- AttributeProviderAttribute.cs
- DataGridViewMethods.cs
- DataGridSortCommandEventArgs.cs
- SplitterCancelEvent.cs
- ServicesExceptionNotHandledEventArgs.cs
- OutKeywords.cs
- TaskFormBase.cs
- XmlToDatasetMap.cs
- VBIdentifierName.cs
- ScrollBarRenderer.cs
- AttributedMetaModel.cs
- EventHandlerList.cs
- SqlServer2KCompatibilityCheck.cs
- BindingOperations.cs
- HScrollBar.cs
- XPathNodeHelper.cs
- DataServiceKeyAttribute.cs
- WaitHandleCannotBeOpenedException.cs
- ClientSideProviderDescription.cs
- NTAccount.cs
- TreeViewItemAutomationPeer.cs
- ResourceAssociationTypeEnd.cs
- SchemaTableColumn.cs
- datacache.cs
- Token.cs
- PerformanceCounterManager.cs
- MSHTMLHost.cs
- Sql8ExpressionRewriter.cs
- ToolBarButtonClickEvent.cs
- PaperSource.cs
- WhitespaceRuleReader.cs
- MultiSelectRootGridEntry.cs
- KerberosSecurityTokenParameters.cs
- elementinformation.cs
- BaseAddressPrefixFilterElement.cs
- DebugViewWriter.cs
- InboundActivityHelper.cs
- BindUriHelper.cs
- InfoCardClaimCollection.cs