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
- SingleAnimationUsingKeyFrames.cs
- TypeDescriptorFilterService.cs
- SystemGatewayIPAddressInformation.cs
- HotSpotCollection.cs
- SqlRowUpdatedEvent.cs
- ToolStripItemCollection.cs
- MessageQueueEnumerator.cs
- PeerNameRegistration.cs
- UnmanagedHandle.cs
- CorrelationManager.cs
- QuaternionRotation3D.cs
- ServiceErrorHandler.cs
- ChtmlTextWriter.cs
- NullableLongMinMaxAggregationOperator.cs
- DoubleLinkList.cs
- RSACryptoServiceProvider.cs
- RegistryKey.cs
- HideDisabledControlAdapter.cs
- XNodeNavigator.cs
- VectorAnimation.cs
- TabletCollection.cs
- RegisteredScript.cs
- SortableBindingList.cs
- TrackingMemoryStreamFactory.cs
- SqlConnection.cs
- PasswordRecovery.cs
- SqlRowUpdatingEvent.cs
- ScrollProviderWrapper.cs
- GridView.cs
- GregorianCalendar.cs
- InfoCardClaimCollection.cs
- DmlSqlGenerator.cs
- EventListenerClientSide.cs
- CqlBlock.cs
- DocumentsTrace.cs
- newinstructionaction.cs
- DesignerSerializerAttribute.cs
- Int32KeyFrameCollection.cs
- ObjectStorage.cs
- _BufferOffsetSize.cs
- FixedSOMTable.cs
- ObjectManager.cs
- CustomTypeDescriptor.cs
- DataGridViewDesigner.cs
- GPStream.cs
- AuthenticationManager.cs
- EntityDataSourceSelectingEventArgs.cs
- TrackingStringDictionary.cs
- COSERVERINFO.cs
- DocumentXPathNavigator.cs
- FormsAuthenticationConfiguration.cs
- TypeUsageBuilder.cs
- AppSettingsExpressionBuilder.cs
- EdgeModeValidation.cs
- FixedFlowMap.cs
- TextOutput.cs
- SpellerHighlightLayer.cs
- ResXResourceWriter.cs
- ToolStripItemCollection.cs
- LoginView.cs
- FontStretch.cs
- Win32Exception.cs
- SortDescriptionCollection.cs
- CopyAttributesAction.cs
- LinearGradientBrush.cs
- FragmentQueryKB.cs
- Cell.cs
- MediaCommands.cs
- CompositeTypefaceMetrics.cs
- WebHttpBehavior.cs
- TraceSection.cs
- SendOperation.cs
- sortedlist.cs
- KeyboardDevice.cs
- ClientApiGenerator.cs
- WmlListAdapter.cs
- EtwTrace.cs
- SortQuery.cs
- EnvironmentPermission.cs
- WebPartEditVerb.cs
- ScriptControlDescriptor.cs
- LiteralControl.cs
- UIntPtr.cs
- ExtensionElementCollection.cs
- COM2Enum.cs
- TextElement.cs
- SplitterDesigner.cs
- DataGridViewToolTip.cs
- ListBox.cs
- OdbcEnvironmentHandle.cs
- CompoundFileIOPermission.cs
- BooleanProjectedSlot.cs
- X509UI.cs
- IdentityReference.cs
- ProbeDuplexAsyncResult.cs
- HelpFileFileNameEditor.cs
- CheckBoxStandardAdapter.cs
- RectValueSerializer.cs
- BinaryWriter.cs
- XmlQualifiedName.cs