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
- NavigationHelper.cs
- DocumentSchemaValidator.cs
- KnownBoxes.cs
- BaseDataList.cs
- MsmqHostedTransportManager.cs
- CellParaClient.cs
- UriSchemeKeyedCollection.cs
- SqlBuilder.cs
- ColumnHeader.cs
- SqlSelectClauseBuilder.cs
- RMEnrollmentPage3.cs
- SemaphoreFullException.cs
- RegistryKey.cs
- SqlCacheDependency.cs
- XmlConvert.cs
- DisposableCollectionWrapper.cs
- odbcmetadatacolumnnames.cs
- SmiMetaData.cs
- NullNotAllowedCollection.cs
- MonthCalendar.cs
- CodeArrayCreateExpression.cs
- MsmqChannelFactoryBase.cs
- ToolboxCategory.cs
- SizeChangedInfo.cs
- StylusPointCollection.cs
- MulticastNotSupportedException.cs
- GridViewRowCollection.cs
- OletxCommittableTransaction.cs
- WebPartHelpVerb.cs
- RegexGroup.cs
- Menu.cs
- MouseOverProperty.cs
- KoreanCalendar.cs
- SqlLiftWhereClauses.cs
- DurableErrorHandler.cs
- PingReply.cs
- InputReferenceExpression.cs
- XmlSchemaObjectTable.cs
- TemplateColumn.cs
- Memoizer.cs
- PerspectiveCamera.cs
- DefaultPropertyAttribute.cs
- AssociationType.cs
- CultureTable.cs
- DbConnectionHelper.cs
- HttpDebugHandler.cs
- MembershipUser.cs
- SwitchLevelAttribute.cs
- WebScriptMetadataFormatter.cs
- InkCollectionBehavior.cs
- RegisteredArrayDeclaration.cs
- SqlBulkCopy.cs
- ToggleProviderWrapper.cs
- PolygonHotSpot.cs
- CodeDomDecompiler.cs
- Slider.cs
- RelationshipEndMember.cs
- CodeSubDirectory.cs
- PrintControllerWithStatusDialog.cs
- TraceContextEventArgs.cs
- CornerRadius.cs
- WebBrowserSiteBase.cs
- Vector3DAnimationBase.cs
- X509CertificateValidator.cs
- SoapInteropTypes.cs
- VSWCFServiceContractGenerator.cs
- SystemIPInterfaceStatistics.cs
- PartialCachingControl.cs
- HMAC.cs
- XPathBinder.cs
- DifferencingCollection.cs
- ExtenderProvidedPropertyAttribute.cs
- DataSourceViewSchemaConverter.cs
- HelpProvider.cs
- MetadataSource.cs
- AttachedAnnotation.cs
- RenderingBiasValidation.cs
- HwndTarget.cs
- System.Data_BID.cs
- CacheMemory.cs
- PaperSize.cs
- SiteMapDataSourceDesigner.cs
- DeflateStream.cs
- DoWhile.cs
- PointKeyFrameCollection.cs
- IdentifierCollection.cs
- MultiTrigger.cs
- UmAlQuraCalendar.cs
- WebPartTransformer.cs
- DelegatedStream.cs
- AlignmentYValidation.cs
- OpenTypeCommon.cs
- ExpressionWriter.cs
- Point3DAnimation.cs
- MULTI_QI.cs
- ParseHttpDate.cs
- ParameterEditorUserControl.cs
- BooleanFacetDescriptionElement.cs
- XamlReader.cs
- CodeSubDirectory.cs