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
- FontStyleConverter.cs
- X509Utils.cs
- MarkupWriter.cs
- BamlResourceContent.cs
- DateTimeFormatInfoScanner.cs
- UnmanagedMemoryStreamWrapper.cs
- SqlNamer.cs
- InvalidPropValue.cs
- Timer.cs
- XmlTypeMapping.cs
- SingleResultAttribute.cs
- LogicalMethodInfo.cs
- LineGeometry.cs
- SafeFileMapViewHandle.cs
- PersonalizationProviderHelper.cs
- DocComment.cs
- InputLanguageCollection.cs
- XmlNavigatorStack.cs
- CompiledQuery.cs
- ToolboxBitmapAttribute.cs
- UriParserTemplates.cs
- NoneExcludedImageIndexConverter.cs
- DynamicDiscoSearcher.cs
- DataBoundControlHelper.cs
- ApplicationInfo.cs
- InheritanceAttribute.cs
- AutomationPatternInfo.cs
- FrugalList.cs
- TypeConstant.cs
- UrlMappingsSection.cs
- FormsIdentity.cs
- AnonymousIdentificationSection.cs
- StickyNoteContentControl.cs
- ConfigurationManagerHelperFactory.cs
- SmiContext.cs
- ListSortDescriptionCollection.cs
- ListViewDeletedEventArgs.cs
- ADMembershipProvider.cs
- SapiRecognizer.cs
- RemotingConfiguration.cs
- IndexOutOfRangeException.cs
- TransformerInfoCollection.cs
- HttpListenerRequestTraceRecord.cs
- OpenFileDialog.cs
- HierarchicalDataBoundControl.cs
- BackStopAuthenticationModule.cs
- ArrayTypeMismatchException.cs
- XslAst.cs
- QilExpression.cs
- TextParaLineResult.cs
- ReceiveErrorHandling.cs
- HttpProfileGroupBase.cs
- QilCloneVisitor.cs
- ModifierKeysValueSerializer.cs
- DeferredElementTreeState.cs
- TriggerCollection.cs
- TreeChangeInfo.cs
- RowToFieldTransformer.cs
- NavigationProgressEventArgs.cs
- XmlNavigatorStack.cs
- localization.cs
- ParentQuery.cs
- HandlerWithFactory.cs
- XmlIncludeAttribute.cs
- Vector3D.cs
- ViewKeyConstraint.cs
- VisemeEventArgs.cs
- DataGridViewSelectedCellCollection.cs
- webeventbuffer.cs
- TimeSpan.cs
- TemplateLookupAction.cs
- CodeFieldReferenceExpression.cs
- DefaultDialogButtons.cs
- TypeConverter.cs
- ClientSideProviderDescription.cs
- ChildrenQuery.cs
- RunInstallerAttribute.cs
- InvalidContentTypeException.cs
- WebPartHelpVerb.cs
- QuaternionAnimation.cs
- ViewStateModeByIdAttribute.cs
- RightsManagementEncryptedStream.cs
- IApplicationTrustManager.cs
- BitmapSourceSafeMILHandle.cs
- ToolBar.cs
- StaticFileHandler.cs
- CompositeKey.cs
- WebPartTransformerAttribute.cs
- MimeTypeMapper.cs
- DrawingAttributes.cs
- FirstQueryOperator.cs
- BaseResourcesBuildProvider.cs
- DataGridViewCellParsingEventArgs.cs
- DeploymentSectionCache.cs
- DashStyle.cs
- MarkupExtensionParser.cs
- HtmlEmptyTagControlBuilder.cs
- ObjectDataSourceWizardForm.cs
- DataControlButton.cs
- HMACSHA1.cs