Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CompMod / System / Diagnostics / BooleanSwitch.cs / 1305376 / BooleanSwitch.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* */ namespace System.Diagnostics { using System.Diagnostics; using System; using System.Security; using System.Security.Permissions; ////// [SwitchLevel(typeof(bool))] public class BooleanSwitch : Switch { ///Provides a simple on/off switch that can be used to control debugging and tracing /// output. ////// public BooleanSwitch(string displayName, string description) : base(displayName, description) { } public BooleanSwitch(string displayName, string description, string defaultSwitchValue) : base(displayName, description, defaultSwitchValue) { } ///Initializes a new instance of the ////// class. /// public bool Enabled { get { return (SwitchSetting == 0) ? false : true; } [SecurityPermission(SecurityAction.LinkDemand, Flags=SecurityPermissionFlag.UnmanagedCode)] set { SwitchSetting = value ? 1 : 0; } } protected override void OnValueChanged() { bool b; if (Boolean.TryParse(Value, out b)) SwitchSetting = ( b ? 1 : 0); else base.OnValueChanged(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.Specifies whether the switch is enabled /// ( ///) or disabled ( ).
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SqlDeflator.cs
- ExpressionVisitor.cs
- ScriptServiceAttribute.cs
- MsmqMessage.cs
- DataKey.cs
- Hash.cs
- SqlConnectionString.cs
- SpotLight.cs
- Vector.cs
- documentsequencetextpointer.cs
- SimpleWorkerRequest.cs
- RefExpr.cs
- ListMarkerSourceInfo.cs
- View.cs
- MultidimensionalArrayItemReference.cs
- Update.cs
- FontUnitConverter.cs
- SiteMap.cs
- ServiceBehaviorAttribute.cs
- DataGridViewCellFormattingEventArgs.cs
- DashStyles.cs
- DiscoveryExceptionDictionary.cs
- SoapFormatExtensions.cs
- TextTabProperties.cs
- DispatcherHookEventArgs.cs
- DataSourceControl.cs
- DataService.cs
- ErrorEventArgs.cs
- BooleanAnimationBase.cs
- Calendar.cs
- LabelEditEvent.cs
- ParenthesizePropertyNameAttribute.cs
- SubpageParaClient.cs
- BrushMappingModeValidation.cs
- RSAPKCS1SignatureDeformatter.cs
- TabletCollection.cs
- XamlFigureLengthSerializer.cs
- XmlConvert.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- ScalarConstant.cs
- SchemaCollectionCompiler.cs
- NativeObjectSecurity.cs
- MulticastNotSupportedException.cs
- TableLayoutStyleCollection.cs
- StrokeRenderer.cs
- CodeStatementCollection.cs
- HostedNamedPipeTransportManager.cs
- X509UI.cs
- Window.cs
- Error.cs
- RadioButtonAutomationPeer.cs
- InstanceDataCollection.cs
- DataAdapter.cs
- Matrix3D.cs
- PublishLicense.cs
- DispatcherEventArgs.cs
- CoreSwitches.cs
- RepeaterDesigner.cs
- NavigationProgressEventArgs.cs
- ListDictionaryInternal.cs
- UIElement3D.cs
- EntityDataSourceContainerNameConverter.cs
- TailPinnedEventArgs.cs
- SchemaCollectionCompiler.cs
- HttpServerChannel.cs
- CanonicalFormWriter.cs
- FileDetails.cs
- HttpResponse.cs
- RemotingConfigParser.cs
- TextTreeRootTextBlock.cs
- SctClaimSerializer.cs
- DecimalFormatter.cs
- SecurityTokenRequirement.cs
- ActivationArguments.cs
- ConnectionStringsExpressionBuilder.cs
- HttpContextWrapper.cs
- storagemappingitemcollection.viewdictionary.cs
- MimeMapping.cs
- ServiceOperation.cs
- BitmapData.cs
- DynamicValidatorEventArgs.cs
- HttpCacheVaryByContentEncodings.cs
- WorkflowMessageEventArgs.cs
- C14NUtil.cs
- TrayIconDesigner.cs
- IisTraceListener.cs
- HyperLinkStyle.cs
- StringValueSerializer.cs
- EdmToObjectNamespaceMap.cs
- PointLight.cs
- GenericPrincipal.cs
- SessionSwitchEventArgs.cs
- TargetConverter.cs
- XamlToRtfParser.cs
- KeyConstraint.cs
- XsltQilFactory.cs
- WebPartDisplayModeEventArgs.cs
- FrameworkContentElement.cs
- RijndaelManaged.cs
- BaseCodeDomTreeGenerator.cs