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
- DynamicMethod.cs
- NumberFunctions.cs
- ScriptResourceAttribute.cs
- UndoUnit.cs
- Subtree.cs
- DifferencingCollection.cs
- MenuCommands.cs
- TraceSource.cs
- ValidationSummaryDesigner.cs
- FrameworkElementAutomationPeer.cs
- PingReply.cs
- AttributeParameterInfo.cs
- Section.cs
- DirectoryInfo.cs
- PeerTransportSecuritySettings.cs
- ImportedNamespaceContextItem.cs
- ModuleBuilderData.cs
- ListViewGroup.cs
- ObjectQuery_EntitySqlExtensions.cs
- CharUnicodeInfo.cs
- InlineObject.cs
- ProxyFragment.cs
- ControlPaint.cs
- DragStartedEventArgs.cs
- MappingMetadataHelper.cs
- PreservationFileReader.cs
- EtwTrace.cs
- DataGridViewCellPaintingEventArgs.cs
- ContextMenuStripActionList.cs
- UnionCodeGroup.cs
- ICollection.cs
- TextOutput.cs
- NavigatingCancelEventArgs.cs
- Application.cs
- TextTreeInsertElementUndoUnit.cs
- Site.cs
- ListViewGroupConverter.cs
- ColorConverter.cs
- BoundField.cs
- MemberExpressionHelper.cs
- ImmComposition.cs
- JavaScriptString.cs
- TableLayoutPanel.cs
- ProviderBase.cs
- CategoryAttribute.cs
- HtmlButton.cs
- DescendantOverDescendantQuery.cs
- DebugView.cs
- ServiceParser.cs
- ThemeDictionaryExtension.cs
- DbParameterCollectionHelper.cs
- ListViewSelectEventArgs.cs
- StorageEndPropertyMapping.cs
- AssociationType.cs
- Animatable.cs
- CorruptStoreException.cs
- printdlgexmarshaler.cs
- InvalidAsynchronousStateException.cs
- DBConcurrencyException.cs
- IUnknownConstantAttribute.cs
- TraceContextEventArgs.cs
- MessageQueueAccessControlEntry.cs
- DispatcherTimer.cs
- FileUtil.cs
- validationstate.cs
- TableLayoutStyle.cs
- EndPoint.cs
- ThicknessKeyFrameCollection.cs
- EmptyReadOnlyDictionaryInternal.cs
- FormsIdentity.cs
- PasswordRecoveryDesigner.cs
- SqlRewriteScalarSubqueries.cs
- DateTimeSerializationSection.cs
- ColumnResizeUndoUnit.cs
- ReliableChannelBinder.cs
- IFlowDocumentViewer.cs
- DataGridViewCellStyle.cs
- ManipulationStartingEventArgs.cs
- FormCollection.cs
- LinqDataSourceStatusEventArgs.cs
- PerspectiveCamera.cs
- DataListItemEventArgs.cs
- NewExpression.cs
- WmlObjectListAdapter.cs
- DataSvcMapFileSerializer.cs
- TextBoxView.cs
- SqlNamer.cs
- MessageQueueKey.cs
- GeneralTransform2DTo3DTo2D.cs
- Expander.cs
- BookmarkNameHelper.cs
- Encoder.cs
- ParserExtension.cs
- AsyncResult.cs
- WebBrowsableAttribute.cs
- SectionInput.cs
- MaterialCollection.cs
- MediaPlayerState.cs
- RequestQueryProcessor.cs
- BaseServiceProvider.cs