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
- SizeFConverter.cs
- FrameworkElementFactoryMarkupObject.cs
- DataPagerField.cs
- PostBackTrigger.cs
- KeyConstraint.cs
- GC.cs
- DelegatedStream.cs
- DATA_BLOB.cs
- DurableErrorHandler.cs
- SystemDropShadowChrome.cs
- XmlAtomicValue.cs
- WindowsTreeView.cs
- HierarchicalDataTemplate.cs
- SrgsElementFactory.cs
- SpeechRecognitionEngine.cs
- WebServiceParameterData.cs
- MemberAccessException.cs
- WebDisplayNameAttribute.cs
- IsolatedStorageException.cs
- Menu.cs
- EntityProviderFactory.cs
- _AutoWebProxyScriptHelper.cs
- ExtensionWindowResizeGrip.cs
- TypeUsage.cs
- DataGridViewComboBoxCell.cs
- CustomTrackingRecord.cs
- HtmlFormWrapper.cs
- SuspendDesigner.cs
- UnmanagedMemoryStreamWrapper.cs
- DrawingCollection.cs
- SystemDropShadowChrome.cs
- FixedDocument.cs
- IndexedString.cs
- IntellisenseTextBox.designer.cs
- WebPartMenu.cs
- FocusManager.cs
- ApplicationException.cs
- ConsoleCancelEventArgs.cs
- __FastResourceComparer.cs
- DataGridViewSortCompareEventArgs.cs
- TextProviderWrapper.cs
- ServiceBusyException.cs
- ToolStripItemCollection.cs
- SessionState.cs
- XMLSchema.cs
- SequenceRange.cs
- MultipleCopiesCollection.cs
- ContractListAdapter.cs
- TextDecoration.cs
- WebPartsPersonalizationAuthorization.cs
- CalendarButtonAutomationPeer.cs
- UrlAuthFailedErrorFormatter.cs
- CodeRemoveEventStatement.cs
- DataSysAttribute.cs
- TextDecorationUnitValidation.cs
- SafeNativeMethods.cs
- WebPartVerb.cs
- PolicyManager.cs
- SHA256Managed.cs
- MailMessage.cs
- TableItemPattern.cs
- MemberPathMap.cs
- BaseDataBoundControl.cs
- Line.cs
- ViewPort3D.cs
- Emitter.cs
- FixedSOMTable.cs
- StrongNameUtility.cs
- BuiltInExpr.cs
- PersonalizationStateInfoCollection.cs
- _SslStream.cs
- XamlRtfConverter.cs
- PropertyContainer.cs
- _UriSyntax.cs
- SQLByte.cs
- AutoGeneratedField.cs
- NativeMethods.cs
- GradientPanel.cs
- SmtpException.cs
- ValidationSummaryDesigner.cs
- UnrecognizedPolicyAssertionElement.cs
- XPathNodeIterator.cs
- DataSourceControl.cs
- DispatcherObject.cs
- DrawingContext.cs
- LinqDataSourceDisposeEventArgs.cs
- PolicyLevel.cs
- SystemBrushes.cs
- BlockUIContainer.cs
- SatelliteContractVersionAttribute.cs
- ToolStripOverflowButton.cs
- ListDesigner.cs
- UriSectionReader.cs
- SiteMapProvider.cs
- NavigationPropertyEmitter.cs
- InitializationEventAttribute.cs
- CultureSpecificStringDictionary.cs
- DataGridViewCheckBoxColumn.cs
- DictionaryContent.cs
- WorkflowClientDeliverMessageWrapper.cs