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
- AutomationEventArgs.cs
- KeyboardNavigation.cs
- FolderBrowserDialog.cs
- DesignerActionList.cs
- Symbol.cs
- WhitespaceRule.cs
- DataSvcMapFile.cs
- EntityCodeGenerator.cs
- XmlSchemaSimpleType.cs
- Parameter.cs
- HttpRequestCacheValidator.cs
- ChannelManager.cs
- HttpHandlerActionCollection.cs
- NamespaceInfo.cs
- DesignerActionVerbItem.cs
- indexingfiltermarshaler.cs
- UnknownWrapper.cs
- BrowserCapabilitiesCompiler.cs
- CoTaskMemHandle.cs
- BooleanSwitch.cs
- SynchronizedInputPattern.cs
- DriveInfo.cs
- SQLCharsStorage.cs
- SourceFilter.cs
- ConfigXmlComment.cs
- ResourceDescriptionAttribute.cs
- SqlUtil.cs
- TraceContextRecord.cs
- ManualResetEvent.cs
- SimpleLine.cs
- EnumUnknown.cs
- FilePrompt.cs
- BitmapEffectGroup.cs
- UIElementIsland.cs
- SplitterPanelDesigner.cs
- LogArchiveSnapshot.cs
- DesignerTransaction.cs
- uribuilder.cs
- MessageVersion.cs
- TcpWorkerProcess.cs
- XPathDocumentNavigator.cs
- SplitterEvent.cs
- RefType.cs
- BinaryWriter.cs
- DataSvcMapFile.cs
- SoapHeader.cs
- QueueProcessor.cs
- BitmapCache.cs
- StyleConverter.cs
- safelink.cs
- DescendantQuery.cs
- MSHTMLHost.cs
- formatter.cs
- FontFamily.cs
- DBNull.cs
- DSASignatureFormatter.cs
- PictureBoxDesigner.cs
- WebBrowserHelper.cs
- SingleConverter.cs
- XmlSerializerAssemblyAttribute.cs
- DurableMessageDispatchInspector.cs
- PropertiesTab.cs
- ProtocolState.cs
- QueryContinueDragEvent.cs
- GridViewUpdatedEventArgs.cs
- ModelServiceImpl.cs
- FixedSOMElement.cs
- XappLauncher.cs
- AsyncResult.cs
- DataGridClipboardHelper.cs
- BufferedReadStream.cs
- DocobjHost.cs
- XmlEventCache.cs
- XmlWrappingReader.cs
- HuffmanTree.cs
- RootDesignerSerializerAttribute.cs
- OfTypeExpression.cs
- ScriptManager.cs
- FileLoadException.cs
- OdbcException.cs
- ValueTypeFixupInfo.cs
- BitSet.cs
- CommandLineParser.cs
- TemplateControlBuildProvider.cs
- DeploymentSection.cs
- FilteredXmlReader.cs
- AdapterUtil.cs
- CalendarDataBindingHandler.cs
- ClassHandlersStore.cs
- ToolStripTextBox.cs
- MenuItem.cs
- Int32Rect.cs
- RegexCaptureCollection.cs
- Gdiplus.cs
- BufferModesCollection.cs
- FixedDocumentPaginator.cs
- ObjectTypeMapping.cs
- BehaviorService.cs
- TrackingLocation.cs
- XPathEmptyIterator.cs