Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- BooleanStorage.cs
- AssociatedControlConverter.cs
- WebPartManagerInternals.cs
- SchemaTableColumn.cs
- ETagAttribute.cs
- CancellationHandlerDesigner.cs
- DBCSCodePageEncoding.cs
- SpellerError.cs
- PhysicalFontFamily.cs
- _NtlmClient.cs
- Validator.cs
- UnitySerializationHolder.cs
- XmlDataProvider.cs
- BuildProvider.cs
- Events.cs
- ConnectionPointGlyph.cs
- XmlIlTypeHelper.cs
- TextProperties.cs
- Vector3DConverter.cs
- CacheOutputQuery.cs
- XpsFixedDocumentSequenceReaderWriter.cs
- CurrencyManager.cs
- InfoCardRSAPKCS1KeyExchangeFormatter.cs
- SizeKeyFrameCollection.cs
- Calendar.cs
- UIElement.cs
- CalendarTable.cs
- ItemsChangedEventArgs.cs
- ResolveNameEventArgs.cs
- CultureInfoConverter.cs
- ValuePattern.cs
- InvalidOleVariantTypeException.cs
- SaveFileDialog.cs
- EntityTypeBase.cs
- AlignmentXValidation.cs
- NavigationService.cs
- EpmTargetTree.cs
- ServiceHost.cs
- TreeView.cs
- FixedLineResult.cs
- InstanceCreationEditor.cs
- AudioSignalProblemOccurredEventArgs.cs
- QueryableDataSourceView.cs
- ThreadStartException.cs
- EntitySqlQueryCacheEntry.cs
- ACL.cs
- CombinedGeometry.cs
- ZoomPercentageConverter.cs
- EntityDataSourceDataSelection.cs
- MenuItem.cs
- AttributeConverter.cs
- FamilyTypefaceCollection.cs
- SrgsDocumentParser.cs
- ResourceManager.cs
- SmiConnection.cs
- BatchServiceHost.cs
- sqlinternaltransaction.cs
- lengthconverter.cs
- Memoizer.cs
- SequenceDesigner.cs
- _WebProxyDataBuilder.cs
- WmiPutTraceRecord.cs
- DesignerActionMethodItem.cs
- WorkflowHostingEndpoint.cs
- ConfigXmlWhitespace.cs
- StylusEventArgs.cs
- DropSource.cs
- ScopeCollection.cs
- CodeCatchClause.cs
- RelationshipNavigation.cs
- PointF.cs
- Win32Exception.cs
- SimpleLine.cs
- Keyboard.cs
- ActionItem.cs
- SessionState.cs
- XmlCountingReader.cs
- RegexReplacement.cs
- AncestorChangedEventArgs.cs
- ScrollBar.cs
- FastEncoderStatics.cs
- VariableQuery.cs
- LineGeometry.cs
- HotCommands.cs
- DefaultTypeArgumentAttribute.cs
- SyndicationSerializer.cs
- SchemaImporterExtensionElement.cs
- DataServiceProviderWrapper.cs
- TableCell.cs
- ObjectStateEntryDbDataRecord.cs
- ConstNode.cs
- DownloadProgressEventArgs.cs
- Soap.cs
- XXXOnTypeBuilderInstantiation.cs
- ExpandCollapseProviderWrapper.cs
- unsafenativemethodstextservices.cs
- ToolBarButton.cs
- MSAAWinEventWrap.cs
- EntityFrameworkVersions.cs
- DataStorage.cs