Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- SqlDependencyUtils.cs
- SQLSingleStorage.cs
- __FastResourceComparer.cs
- HyperLinkColumn.cs
- SmtpCommands.cs
- WebPartsPersonalizationAuthorization.cs
- OLEDB_Util.cs
- XmlSchemaGroup.cs
- FastPropertyAccessor.cs
- SoapElementAttribute.cs
- DataGridGeneralPage.cs
- RequestQueryProcessor.cs
- DateTimeOffset.cs
- InkSerializer.cs
- EntityDataSourceUtil.cs
- StylusButtonEventArgs.cs
- TypeDescriptionProvider.cs
- RegexWriter.cs
- DiscardableAttribute.cs
- GenericAuthenticationEventArgs.cs
- WindowsButton.cs
- dataobject.cs
- LookupBindingPropertiesAttribute.cs
- SurrogateEncoder.cs
- ManifestResourceInfo.cs
- DockingAttribute.cs
- _SSPIWrapper.cs
- Int32Converter.cs
- ApplicationHost.cs
- MediaSystem.cs
- EncodingInfo.cs
- Form.cs
- ObjectView.cs
- OleDbWrapper.cs
- CommandPlan.cs
- EventListener.cs
- SystemWebSectionGroup.cs
- Query.cs
- CodeTypeReferenceExpression.cs
- OracleConnectionFactory.cs
- CertificateManager.cs
- ComponentCache.cs
- ButtonField.cs
- HealthMonitoringSectionHelper.cs
- XmlAtomicValue.cs
- M3DUtil.cs
- MessageProtectionOrder.cs
- NativeMethods.cs
- ParserExtension.cs
- SortedList.cs
- ImageSourceConverter.cs
- DispatcherSynchronizationContext.cs
- OperatingSystem.cs
- UnsafeNativeMethods.cs
- EncryptedPackage.cs
- BufferModeSettings.cs
- RuntimeConfig.cs
- DummyDataSource.cs
- MethodBuilderInstantiation.cs
- Setter.cs
- ProtocolInformationReader.cs
- AssemblyAssociatedContentFileAttribute.cs
- UrlAuthorizationModule.cs
- KeyConverter.cs
- StreamWriter.cs
- ProfileSettings.cs
- RowToFieldTransformer.cs
- ReflectionServiceProvider.cs
- ReaderWriterLock.cs
- SelectionUIHandler.cs
- MappedMetaModel.cs
- ReadOnlyDictionary.cs
- FlowDocumentFormatter.cs
- DragDrop.cs
- Int64.cs
- WindowsGraphics.cs
- RegistryExceptionHelper.cs
- StyleCollection.cs
- XappLauncher.cs
- InstanceLockLostException.cs
- TraceListener.cs
- ProgressPage.cs
- TTSEvent.cs
- Byte.cs
- ControlParameter.cs
- DataGridViewIntLinkedList.cs
- ClonableStack.cs
- FlowDecision.cs
- MultiTrigger.cs
- Span.cs
- XPathNode.cs
- AutoGeneratedFieldProperties.cs
- WebPageTraceListener.cs
- ToolboxComponentsCreatedEventArgs.cs
- TypeExtension.cs
- NamedPipeAppDomainProtocolHandler.cs
- TreeViewDesigner.cs
- SystemDiagnosticsSection.cs
- HitTestParameters.cs
- TraceData.cs