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
- XmlDocumentSurrogate.cs
- PeerPresenceInfo.cs
- _BasicClient.cs
- AppendHelper.cs
- PartialTrustVisibleAssembliesSection.cs
- SweepDirectionValidation.cs
- PlainXmlWriter.cs
- BackgroundWorker.cs
- Win32SafeHandles.cs
- Wildcard.cs
- SmiContextFactory.cs
- MobileControlsSection.cs
- DocumentOutline.cs
- DataError.cs
- ActivityExecutionContextCollection.cs
- HashHelper.cs
- ExpressionEditorSheet.cs
- PeerCollaborationPermission.cs
- StringCollection.cs
- CallbackTimeoutsBehavior.cs
- ObjectAssociationEndMapping.cs
- KnowledgeBase.cs
- BitmapEffectCollection.cs
- FreezableCollection.cs
- StrokeCollectionDefaultValueFactory.cs
- Renderer.cs
- SqlEnums.cs
- PageOrientation.cs
- DesignerOptions.cs
- Light.cs
- LinqMaximalSubtreeNominator.cs
- EmbossBitmapEffect.cs
- TextElementEditingBehaviorAttribute.cs
- TabletDevice.cs
- MaskInputRejectedEventArgs.cs
- HuffModule.cs
- ThrowHelper.cs
- Duration.cs
- ArithmeticException.cs
- CollectionDataContractAttribute.cs
- OperationCanceledException.cs
- ServerIdentity.cs
- FileSecurity.cs
- CTreeGenerator.cs
- ImageEditor.cs
- XamlPathDataSerializer.cs
- BasicHttpSecurityMode.cs
- XmlChoiceIdentifierAttribute.cs
- ConfigurationStrings.cs
- CompilerGlobalScopeAttribute.cs
- IriParsingElement.cs
- LogSwitch.cs
- IPHostEntry.cs
- LazyTextWriterCreator.cs
- FormattedText.cs
- DesignerActionUIStateChangeEventArgs.cs
- FontWeights.cs
- _AutoWebProxyScriptHelper.cs
- TableRow.cs
- RuleSettingsCollection.cs
- EventMappingSettingsCollection.cs
- WebPartCatalogAddVerb.cs
- ProjectionPathSegment.cs
- BinaryReader.cs
- IDReferencePropertyAttribute.cs
- LinkConverter.cs
- EntitySqlQueryState.cs
- NameObjectCollectionBase.cs
- TextRunProperties.cs
- AspNetHostingPermission.cs
- SqlAliasesReferenced.cs
- XmlSchemaSimpleTypeUnion.cs
- connectionpool.cs
- ListViewGroup.cs
- OutOfProcStateClientManager.cs
- ApplicationSecurityManager.cs
- EndPoint.cs
- _HelperAsyncResults.cs
- InputQueue.cs
- TagPrefixInfo.cs
- ValidatedControlConverter.cs
- ComplexType.cs
- StyleCollection.cs
- Point3D.cs
- StackBuilderSink.cs
- figurelength.cs
- StrongName.cs
- SystemResourceHost.cs
- GenericWebPart.cs
- BufferedGraphics.cs
- GeometryGroup.cs
- JsonServiceDocumentSerializer.cs
- Message.cs
- CaretElement.cs
- DefaultExpression.cs
- HostExecutionContextManager.cs
- AtomServiceDocumentSerializer.cs
- WindowsListViewGroupHelper.cs
- GraphicsContainer.cs
- RequestStatusBarUpdateEventArgs.cs