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
- UniformGrid.cs
- PersonalizationStateInfo.cs
- ManagedCodeMarkers.cs
- COAUTHINFO.cs
- Journal.cs
- HostedElements.cs
- AnimatedTypeHelpers.cs
- Rotation3DAnimationBase.cs
- XamlTreeBuilderBamlRecordWriter.cs
- COMException.cs
- SecurityVerifiedMessage.cs
- SrgsDocument.cs
- NavigationExpr.cs
- EmptyReadOnlyDictionaryInternal.cs
- XhtmlTextWriter.cs
- CultureTableRecord.cs
- Highlights.cs
- TemplateControl.cs
- ComponentFactoryHelpers.cs
- BitStream.cs
- ProtectedUri.cs
- XomlDesignerLoader.cs
- versioninfo.cs
- Misc.cs
- ResetableIterator.cs
- ForeignConstraint.cs
- ExecutedRoutedEventArgs.cs
- CollectionTypeElement.cs
- ColumnPropertiesGroup.cs
- Blend.cs
- BitmapEffect.cs
- ColorBlend.cs
- X509WindowsSecurityToken.cs
- ConstantExpression.cs
- SelectionEditor.cs
- _SSPIWrapper.cs
- EntityConnectionStringBuilderItem.cs
- HttpStreamMessage.cs
- ConfigurationManagerInternal.cs
- XmlLangPropertyAttribute.cs
- ExpressionBuilder.cs
- ColumnReorderedEventArgs.cs
- ProgressBar.cs
- ColumnCollection.cs
- DesignerActionVerbList.cs
- SqlFormatter.cs
- VoiceObjectToken.cs
- basevalidator.cs
- HexParser.cs
- DataError.cs
- SharedStatics.cs
- TextProperties.cs
- IntegerValidatorAttribute.cs
- TemplateControlCodeDomTreeGenerator.cs
- StylusPointPropertyInfoDefaults.cs
- XmlProcessingInstruction.cs
- TransformerTypeCollection.cs
- CommandManager.cs
- SettingsPropertyValue.cs
- TableRowCollection.cs
- ImageConverter.cs
- TransformerConfigurationWizardBase.cs
- ConnectionManagementSection.cs
- DataGridColumnCollection.cs
- SqlBulkCopyColumnMappingCollection.cs
- WebPartConnectionsConnectVerb.cs
- OracleBFile.cs
- TextTreeDeleteContentUndoUnit.cs
- RectangleGeometry.cs
- FrameworkContextData.cs
- FileChangesMonitor.cs
- FixedPage.cs
- SupportsEventValidationAttribute.cs
- Context.cs
- Timer.cs
- RootBrowserWindow.cs
- CodeBlockBuilder.cs
- GeometryModel3D.cs
- PassportAuthenticationModule.cs
- SchemaLookupTable.cs
- RecognitionResult.cs
- WeakEventTable.cs
- JsonWriter.cs
- SizeKeyFrameCollection.cs
- TypeUnloadedException.cs
- HttpServerVarsCollection.cs
- HtmlInputSubmit.cs
- UIPropertyMetadata.cs
- XmlILAnnotation.cs
- SessionEndingCancelEventArgs.cs
- PropagatorResult.cs
- Stack.cs
- DataRowCollection.cs
- TagNameToTypeMapper.cs
- Delegate.cs
- Comparer.cs
- HttpHeaderCollection.cs
- WinFormsUtils.cs
- LayoutEditorPart.cs
- ScriptDescriptor.cs