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
- TerminateDesigner.cs
- CacheForPrimitiveTypes.cs
- Stylus.cs
- SerializationStore.cs
- SessionEndingEventArgs.cs
- FontCacheLogic.cs
- CrossAppDomainChannel.cs
- DataGridViewButtonColumn.cs
- SqlTypeSystemProvider.cs
- HMACSHA512.cs
- ChineseLunisolarCalendar.cs
- Rotation3D.cs
- TemplatedAdorner.cs
- QuestionEventArgs.cs
- ObjectManager.cs
- RijndaelManaged.cs
- PageBuildProvider.cs
- Selector.cs
- FontEmbeddingManager.cs
- UIInitializationException.cs
- XmlSchemaObjectTable.cs
- GrammarBuilder.cs
- Hash.cs
- QuaternionRotation3D.cs
- SecurityPermission.cs
- ToolStripSplitStackLayout.cs
- ExclusiveNamedPipeTransportManager.cs
- MenuAutomationPeer.cs
- EventDescriptorCollection.cs
- ListDictionary.cs
- ComponentChangingEvent.cs
- TemplateControlBuildProvider.cs
- HttpSysSettings.cs
- ArraySortHelper.cs
- Lasso.cs
- ObjectListSelectEventArgs.cs
- SpellerStatusTable.cs
- NamedPermissionSet.cs
- TimelineCollection.cs
- FixedTextView.cs
- PackWebResponse.cs
- NameValuePermission.cs
- SignatureTargetIdManager.cs
- CompiledQueryCacheKey.cs
- Marshal.cs
- CompilerGeneratedAttribute.cs
- SurrogateEncoder.cs
- DiagnosticTrace.cs
- URIFormatException.cs
- ImageButton.cs
- _WinHttpWebProxyDataBuilder.cs
- HtmlTableCellCollection.cs
- GACMembershipCondition.cs
- Native.cs
- mda.cs
- GeneralTransform3DTo2D.cs
- RIPEMD160Managed.cs
- DictionaryEntry.cs
- CalloutQueueItem.cs
- CapiHashAlgorithm.cs
- Error.cs
- Shape.cs
- PtsHelper.cs
- TripleDES.cs
- SoapMessage.cs
- ClientRuntimeConfig.cs
- TaskCanceledException.cs
- SettingsPropertyValue.cs
- NodeLabelEditEvent.cs
- InternalTypeHelper.cs
- TiffBitmapEncoder.cs
- HttpRuntime.cs
- TransportDefaults.cs
- ProjectionPathBuilder.cs
- Interlocked.cs
- BaseDataList.cs
- QueryAccessibilityHelpEvent.cs
- DataControlPagerLinkButton.cs
- ToolStripDropDownMenu.cs
- ContainerControl.cs
- WorkflowServiceNamespace.cs
- ToolStripContentPanelRenderEventArgs.cs
- CodeComment.cs
- RegisteredHiddenField.cs
- VersionedStream.cs
- DataListCommandEventArgs.cs
- HandleRef.cs
- CompilerTypeWithParams.cs
- PickBranch.cs
- FieldAccessException.cs
- XmlCharType.cs
- HtmlEncodedRawTextWriter.cs
- WebPartsPersonalization.cs
- DataQuery.cs
- VirtualizingStackPanel.cs
- CatalogZone.cs
- ConvertEvent.cs
- RowsCopiedEventArgs.cs
- GPPOINTF.cs
- SystemTcpStatistics.cs