Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / CompMod / System / Diagnostics / BooleanSwitch.cs / 1 / 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(); } } }Specifies whether the switch is enabled /// ( ///) or disabled ( ).
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DbConnectionHelper.cs
- PointConverter.cs
- ExtendedProperty.cs
- WorkflowApplicationException.cs
- CodeParameterDeclarationExpression.cs
- MD5CryptoServiceProvider.cs
- MobileControlBuilder.cs
- EventKeyword.cs
- InvalidPipelineStoreException.cs
- WebMessageEncodingBindingElement.cs
- TreeNodeBindingCollection.cs
- InvalidFilterCriteriaException.cs
- _ProxyRegBlob.cs
- LinqDataSourceHelper.cs
- SemaphoreFullException.cs
- WorkflowFileItem.cs
- CompensationToken.cs
- SqlConnectionHelper.cs
- AsymmetricSecurityBindingElement.cs
- DBBindings.cs
- TagPrefixAttribute.cs
- CqlGenerator.cs
- ResourceProviderFactory.cs
- MappingException.cs
- HelpInfo.cs
- RelatedEnd.cs
- Repeater.cs
- IdentitySection.cs
- WindowsAuthenticationModule.cs
- TableLayoutSettingsTypeConverter.cs
- SizeKeyFrameCollection.cs
- webbrowsersite.cs
- EnumBuilder.cs
- DataExpression.cs
- SecurityContext.cs
- HtmlWindowCollection.cs
- DataGridViewCellValueEventArgs.cs
- ObjectNavigationPropertyMapping.cs
- GridViewDeleteEventArgs.cs
- CheckedListBox.cs
- RelOps.cs
- GraphicsState.cs
- WasHttpHandlersInstallComponent.cs
- ContentControl.cs
- TextEmbeddedObject.cs
- FixedTextContainer.cs
- CriticalHandle.cs
- WebBrowserUriTypeConverter.cs
- MappedMetaModel.cs
- RemotingService.cs
- DbXmlEnabledProviderManifest.cs
- DataGridViewCellToolTipTextNeededEventArgs.cs
- BuildManager.cs
- MexBindingElement.cs
- LinqDataSourceHelper.cs
- NotSupportedException.cs
- CheckBox.cs
- SmiEventSink.cs
- SqlCommand.cs
- PipeStream.cs
- embossbitmapeffect.cs
- EnumBuilder.cs
- Expression.cs
- ArglessEventHandlerProxy.cs
- infer.cs
- ObjectDataSourceMethodEventArgs.cs
- TableCell.cs
- ReservationCollection.cs
- SafeWaitHandle.cs
- WebPartZoneBase.cs
- InkCanvasSelectionAdorner.cs
- RegexCompilationInfo.cs
- BaseDataBoundControl.cs
- PreviewControlDesigner.cs
- ConsoleTraceListener.cs
- WorkflowServiceNamespace.cs
- AssemblyBuilderData.cs
- ImageConverter.cs
- UpdateCommand.cs
- ToolStripItemEventArgs.cs
- LogEntryHeaderDeserializer.cs
- EndEvent.cs
- SystemDropShadowChrome.cs
- FixedSchema.cs
- URLString.cs
- TabControl.cs
- ConfigurationStrings.cs
- ListBoxItemWrapperAutomationPeer.cs
- ScriptBehaviorDescriptor.cs
- Span.cs
- QilLoop.cs
- SecurityKeyType.cs
- WindowsListBox.cs
- wgx_sdk_version.cs
- XXXOnTypeBuilderInstantiation.cs
- ExpressionTextBox.xaml.cs
- TaiwanCalendar.cs
- DynamicPropertyHolder.cs
- KoreanLunisolarCalendar.cs
- WorkflowServiceBuildProvider.cs