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
- TargetException.cs
- Process.cs
- Substitution.cs
- X509ChainElement.cs
- WebConfigurationFileMap.cs
- SBCSCodePageEncoding.cs
- RuntimeConfigurationRecord.cs
- ConfigurationValidatorAttribute.cs
- XhtmlConformanceSection.cs
- DateTimeUtil.cs
- TraceRecord.cs
- BamlTreeUpdater.cs
- PartialCachingAttribute.cs
- IxmlLineInfo.cs
- ComNativeDescriptor.cs
- HandlerFactoryWrapper.cs
- Mouse.cs
- InternalPermissions.cs
- ListItemCollection.cs
- Terminate.cs
- CustomCredentialPolicy.cs
- SessionPageStateSection.cs
- ButtonBaseAdapter.cs
- DbConnectionClosed.cs
- ProcessThread.cs
- ArraySet.cs
- SystemFonts.cs
- TransformProviderWrapper.cs
- Path.cs
- PasswordBoxAutomationPeer.cs
- RecordConverter.cs
- HttpDictionary.cs
- ComponentEditorForm.cs
- WorkflowMarkupSerializationProvider.cs
- MouseOverProperty.cs
- Figure.cs
- DescendantQuery.cs
- AttributeEmitter.cs
- XmlSchemaAnnotated.cs
- SpanIndex.cs
- RectKeyFrameCollection.cs
- EventHandlerService.cs
- DateTimeFormatInfoScanner.cs
- IConvertible.cs
- OracleCommandSet.cs
- SHA512.cs
- InputLanguageSource.cs
- Rect3D.cs
- ComboBox.cs
- FrameworkElement.cs
- MSAAEventDispatcher.cs
- TdsParserStateObject.cs
- SqlWebEventProvider.cs
- IPEndPoint.cs
- XsdValidatingReader.cs
- GacUtil.cs
- DragEvent.cs
- ReadWriteSpinLock.cs
- ZoneLinkButton.cs
- DataService.cs
- ErrorHandler.cs
- XslCompiledTransform.cs
- SqlHelper.cs
- RequestCache.cs
- StylusPointPropertyInfoDefaults.cs
- ContractMapping.cs
- TreeWalker.cs
- FileIOPermission.cs
- Debug.cs
- XmlCharType.cs
- figurelength.cs
- SqlTypesSchemaImporter.cs
- PtsContext.cs
- FileSecurity.cs
- NameSpaceExtractor.cs
- SqlBooleanizer.cs
- CustomTypeDescriptor.cs
- QuaternionConverter.cs
- NativeMethods.cs
- Events.cs
- InternalSafeNativeMethods.cs
- Selector.cs
- Thread.cs
- ListenerChannelContext.cs
- BrowserCapabilitiesFactoryBase.cs
- Polygon.cs
- FontFamily.cs
- ObjectDataSourceFilteringEventArgs.cs
- ProfileService.cs
- SrgsSubset.cs
- AddInProcess.cs
- WindowsListViewItem.cs
- ServiceOperationParameter.cs
- DupHandleConnectionReader.cs
- JournalEntryListConverter.cs
- ExpressionBuilder.cs
- VarRefManager.cs
- Stopwatch.cs
- SafeCryptContextHandle.cs
- CodeIndexerExpression.cs