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
- DockAndAnchorLayout.cs
- UInt16.cs
- CheckBox.cs
- IImplicitResourceProvider.cs
- XmlStreamStore.cs
- ListViewContainer.cs
- StylusPlugin.cs
- GenericTypeParameterBuilder.cs
- StateWorkerRequest.cs
- GenericsInstances.cs
- Application.cs
- CommonGetThemePartSize.cs
- OleAutBinder.cs
- DataSourceControlBuilder.cs
- SqlClientWrapperSmiStreamChars.cs
- CreatingCookieEventArgs.cs
- GenericRootAutomationPeer.cs
- DecoderReplacementFallback.cs
- SymLanguageVendor.cs
- DataGridViewLayoutData.cs
- MatrixCamera.cs
- PasswordRecovery.cs
- ListBindingConverter.cs
- DiscoveryClientReferences.cs
- COM2ExtendedBrowsingHandler.cs
- CrossContextChannel.cs
- QuaternionRotation3D.cs
- SQLInt64Storage.cs
- LicenseProviderAttribute.cs
- SimpleHandlerFactory.cs
- XmlAnyElementAttribute.cs
- UserNameSecurityTokenProvider.cs
- WhitespaceRuleLookup.cs
- SQLSingleStorage.cs
- GeometryHitTestResult.cs
- _SSPISessionCache.cs
- mediaclock.cs
- RoleService.cs
- CatalogPartCollection.cs
- ValidationError.cs
- WebPartPersonalization.cs
- EventMap.cs
- LocatorPart.cs
- DecimalConverter.cs
- SpanIndex.cs
- HwndAppCommandInputProvider.cs
- AnnotationAuthorChangedEventArgs.cs
- CommentEmitter.cs
- OrderingQueryOperator.cs
- CLRBindingWorker.cs
- SqlDataSourceRefreshSchemaForm.cs
- Operator.cs
- SmtpLoginAuthenticationModule.cs
- ValueSerializerAttribute.cs
- FrameworkEventSource.cs
- UnsafeNativeMethods.cs
- CodeTypeOfExpression.cs
- IdentityReference.cs
- AspCompat.cs
- ListBox.cs
- BlurBitmapEffect.cs
- HtmlGenericControl.cs
- SqlConnectionPoolGroupProviderInfo.cs
- Base64WriteStateInfo.cs
- TableLayoutPanelCodeDomSerializer.cs
- VirtualDirectoryMappingCollection.cs
- EncoderNLS.cs
- StylusPoint.cs
- WindowsIPAddress.cs
- FillBehavior.cs
- DoubleAnimationUsingPath.cs
- __Filters.cs
- RightNameExpirationInfoPair.cs
- FlowDocument.cs
- EventToken.cs
- SafeSecurityHelper.cs
- HtmlGenericControl.cs
- PrefixHandle.cs
- TextRunCache.cs
- ColumnTypeConverter.cs
- PkcsMisc.cs
- CodeDirectionExpression.cs
- MultiView.cs
- TextModifierScope.cs
- GlobalAclOperationRequirement.cs
- KnowledgeBase.cs
- StreamUpdate.cs
- storepermission.cs
- StylusPointPropertyUnit.cs
- PocoPropertyAccessorStrategy.cs
- Int32Rect.cs
- VsPropertyGrid.cs
- DiscoveryDocumentSearchPattern.cs
- PersonalizationProviderCollection.cs
- HttpServerVarsCollection.cs
- WebPageTraceListener.cs
- XAMLParseException.cs
- StringValueSerializer.cs
- BindingNavigatorDesigner.cs
- TickBar.cs