Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CompMod / System / Diagnostics / SourceSwitch.cs / 1305376 / 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
- DictionaryBase.cs
- KeyEvent.cs
- FixUp.cs
- DoWorkEventArgs.cs
- PermissionSetEnumerator.cs
- XComponentModel.cs
- ServiceObjectContainer.cs
- IdentitySection.cs
- BaseResourcesBuildProvider.cs
- BinaryKeyIdentifierClause.cs
- ScriptingAuthenticationServiceSection.cs
- HandleCollector.cs
- Deserializer.cs
- WpfWebRequestHelper.cs
- TableColumn.cs
- _AcceptOverlappedAsyncResult.cs
- SqlClientPermission.cs
- ListViewInsertedEventArgs.cs
- GroupDescription.cs
- securitymgrsite.cs
- XmlSerializationGeneratedCode.cs
- WindowsScrollBar.cs
- EventDrivenDesigner.cs
- dtdvalidator.cs
- BaseTemplateCodeDomTreeGenerator.cs
- ConfigXmlDocument.cs
- ChangeDirector.cs
- UseLicense.cs
- StorageRoot.cs
- ChannelSinkStacks.cs
- MethodAccessException.cs
- ConfigurationPropertyCollection.cs
- PixelFormats.cs
- TextTreeNode.cs
- SQLMoney.cs
- RMPublishingDialog.cs
- DataGridViewCellEventArgs.cs
- CatalogZone.cs
- Msec.cs
- ObjectStateEntryDbUpdatableDataRecord.cs
- XmlReturnWriter.cs
- ElementUtil.cs
- GroupBox.cs
- CaretElement.cs
- ProxyElement.cs
- DesignTimeTemplateParser.cs
- Certificate.cs
- FrameSecurityDescriptor.cs
- OleDbCommand.cs
- TransactionFlowBindingElement.cs
- BrushMappingModeValidation.cs
- XLinq.cs
- HwndStylusInputProvider.cs
- SecUtil.cs
- InkCanvasInnerCanvas.cs
- Brush.cs
- SendActivityDesignerTheme.cs
- TypeUtil.cs
- CustomWebEventKey.cs
- MetadataPropertyAttribute.cs
- SignedInfo.cs
- EarlyBoundInfo.cs
- ServiceDiscoveryBehavior.cs
- DragSelectionMessageFilter.cs
- XmlNamespaceDeclarationsAttribute.cs
- ToolStripRenderer.cs
- EraserBehavior.cs
- SmtpAuthenticationManager.cs
- RankException.cs
- Sequence.cs
- FormViewUpdatedEventArgs.cs
- EntityUtil.cs
- Invariant.cs
- ReferencedCollectionType.cs
- AnnotationHighlightLayer.cs
- NonParentingControl.cs
- SpnegoTokenAuthenticator.cs
- DomainUpDown.cs
- TouchesOverProperty.cs
- IERequestCache.cs
- BrushValueSerializer.cs
- SourceElementsCollection.cs
- elementinformation.cs
- CqlBlock.cs
- ControlBuilderAttribute.cs
- SelectionChangedEventArgs.cs
- ArcSegment.cs
- SkewTransform.cs
- DataGrid.cs
- DataGridViewSelectedCellCollection.cs
- PerformanceCounterPermissionEntryCollection.cs
- EnvelopedSignatureTransform.cs
- RunClient.cs
- FixedPage.cs
- ArrayMergeHelper.cs
- FormatterConverter.cs
- UICuesEvent.cs
- NotCondition.cs
- TextAnchor.cs
- PseudoWebRequest.cs