Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- TableRowsCollectionEditor.cs
- UnSafeCharBuffer.cs
- SqlDataSourceFilteringEventArgs.cs
- Registration.cs
- SqlConnectionStringBuilder.cs
- Asn1Utilities.cs
- input.cs
- base64Transforms.cs
- DataBoundLiteralControl.cs
- FastEncoderWindow.cs
- MultilineStringEditor.cs
- BreakRecordTable.cs
- CompletionCallbackWrapper.cs
- TreeViewBindingsEditorForm.cs
- MailMessage.cs
- MachineKeyConverter.cs
- DataGridViewSelectedCellCollection.cs
- ArraySegment.cs
- Vector3DCollectionConverter.cs
- PackageRelationship.cs
- ProtectedConfiguration.cs
- TypeSystemProvider.cs
- WebHttpDispatchOperationSelector.cs
- SpanIndex.cs
- SynchronizationLockException.cs
- PreloadedPackages.cs
- BinarySecretKeyIdentifierClause.cs
- XPathException.cs
- WrappedKeySecurityToken.cs
- Expression.cs
- FlowPosition.cs
- SoapExtensionTypeElement.cs
- Application.cs
- DataControlButton.cs
- PresentationSource.cs
- TemplateParser.cs
- AutoGeneratedFieldProperties.cs
- ServiceObjectContainer.cs
- counter.cs
- TextLine.cs
- TextServicesDisplayAttribute.cs
- DesignerHierarchicalDataSourceView.cs
- sqlpipe.cs
- OdbcEnvironmentHandle.cs
- coordinator.cs
- IntranetCredentialPolicy.cs
- LinqDataSourceSelectEventArgs.cs
- TypeReference.cs
- StructuralCache.cs
- IdentityElement.cs
- HttpModulesSection.cs
- CompiledQueryCacheKey.cs
- ContextMenuAutomationPeer.cs
- ObjectFullSpanRewriter.cs
- ScaleTransform3D.cs
- BrushMappingModeValidation.cs
- AppDomainProtocolHandler.cs
- Reference.cs
- CheckBoxStandardAdapter.cs
- MasterPageCodeDomTreeGenerator.cs
- XmlSchemaNotation.cs
- DetailsViewDeletedEventArgs.cs
- XPathArrayIterator.cs
- XamlVector3DCollectionSerializer.cs
- DecimalConstantAttribute.cs
- _AutoWebProxyScriptWrapper.cs
- FeatureManager.cs
- Stackframe.cs
- Msec.cs
- BindingExpression.cs
- tibetanshape.cs
- SecurityHelper.cs
- ConfigUtil.cs
- ChildTable.cs
- AssemblyBuilder.cs
- HwndSource.cs
- MetadataImporter.cs
- StaticExtensionConverter.cs
- TypeHelpers.cs
- SmiRecordBuffer.cs
- OperationValidationEventArgs.cs
- TypeReference.cs
- SafeRightsManagementSessionHandle.cs
- ListenerUnsafeNativeMethods.cs
- OleDbCommand.cs
- ImpersonateTokenRef.cs
- TextServicesLoader.cs
- SiteMapNodeItemEventArgs.cs
- HScrollProperties.cs
- AspNetSynchronizationContext.cs
- FragmentQueryProcessor.cs
- GenericTypeParameterBuilder.cs
- TableLayoutColumnStyleCollection.cs
- ClientFactory.cs
- WindowsIPAddress.cs
- MediaSystem.cs
- BindValidationContext.cs
- SqlDataSourceCommandEventArgs.cs
- MergablePropertyAttribute.cs
- SmiSettersStream.cs