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
- BoolLiteral.cs
- SecuritySessionSecurityTokenAuthenticator.cs
- GPStream.cs
- MimeWriter.cs
- BrowserDefinition.cs
- MdImport.cs
- TemplatedWizardStep.cs
- ElementFactory.cs
- TabControlCancelEvent.cs
- Nodes.cs
- TypeDependencyAttribute.cs
- GeneralTransform3DGroup.cs
- HttpModuleAction.cs
- EntityProviderServices.cs
- RegistrySecurity.cs
- ContentAlignmentEditor.cs
- KeyFrames.cs
- MouseGesture.cs
- StateMachineSubscription.cs
- CodeBinaryOperatorExpression.cs
- SqlDataSourceCustomCommandPanel.cs
- XmlDocumentSurrogate.cs
- WorkflowValidationFailedException.cs
- XmlBinaryReader.cs
- BmpBitmapEncoder.cs
- WebSysDefaultValueAttribute.cs
- ObjectPropertyMapping.cs
- FileIOPermission.cs
- mda.cs
- RoleService.cs
- EmptyEnumerator.cs
- CachedFontFamily.cs
- Variable.cs
- SystemIPGlobalProperties.cs
- ColorConvertedBitmap.cs
- PreviewControlDesigner.cs
- RegexTree.cs
- Bitmap.cs
- EndPoint.cs
- SplitterPanel.cs
- ImmComposition.cs
- InterleavedZipPartStream.cs
- IPPacketInformation.cs
- CodeNamespaceCollection.cs
- SqlRowUpdatingEvent.cs
- ZoneLinkButton.cs
- OpenFileDialog.cs
- InternalControlCollection.cs
- DbBuffer.cs
- WebPartEditorApplyVerb.cs
- MessageSmuggler.cs
- HostProtectionPermission.cs
- ZipPackage.cs
- BoundField.cs
- VBIdentifierNameEditor.cs
- InfoCardTrace.cs
- BindToObject.cs
- TypeHelpers.cs
- Stack.cs
- CapabilitiesPattern.cs
- MethodBuilderInstantiation.cs
- MimeTypeAttribute.cs
- ConfigurationValues.cs
- ProcessingInstructionAction.cs
- ConfigXmlText.cs
- PriorityQueue.cs
- XmlUtf8RawTextWriter.cs
- DataGridLinkButton.cs
- CaseKeyBox.xaml.cs
- StringUtil.cs
- KeyedHashAlgorithm.cs
- FixedNode.cs
- XamlReader.cs
- SqlCacheDependencySection.cs
- ComponentCollection.cs
- TypeDescriptor.cs
- InheritanceContextChangedEventManager.cs
- ZipIOCentralDirectoryDigitalSignature.cs
- Deserializer.cs
- PixelFormats.cs
- ThemeInfoAttribute.cs
- IOThreadScheduler.cs
- Selector.cs
- CompositeActivityDesigner.cs
- ExeConfigurationFileMap.cs
- PinnedBufferMemoryStream.cs
- ColorBlend.cs
- AggregateNode.cs
- Comparer.cs
- SchemaDeclBase.cs
- CreateUserErrorEventArgs.cs
- SqlDataSourceView.cs
- ServicesUtilities.cs
- SslStream.cs
- BamlLocalizer.cs
- VariableExpressionConverter.cs
- OdbcConnectionPoolProviderInfo.cs
- IDQuery.cs
- HMACSHA512.cs
- PageThemeParser.cs