Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / clr / src / BCL / System / ConsoleCancelEventArgs.cs / 1 / ConsoleCancelEventArgs.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================================== ** ** Class: ConsoleCancelEventArgs ** ** ** Purpose: This class provides support goop for hooking Control-C and ** Control-Break, then preventing Control-C from interrupting the ** process. ** ** =============================================================================*/ namespace System { using System; public delegate void ConsoleCancelEventHandler(Object sender, ConsoleCancelEventArgs e); [Serializable] public sealed class ConsoleCancelEventArgs : EventArgs { private ConsoleSpecialKey _type; private bool _cancel; // Whether to cancel the CancelKeyPress event internal ConsoleCancelEventArgs(ConsoleSpecialKey type) { _type = type; _cancel = false; } // Whether to cancel the break event. By setting this to true, the // Control-C will not kill the process. public bool Cancel { get { return _cancel; } set { if (_type == ConsoleSpecialKey.ControlBreak && value == true) throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CantCancelCtrlBreak")); _cancel = value; } } public ConsoleSpecialKey SpecialKey { get { return _type; } } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- NameSpaceExtractor.cs
- TreeViewHitTestInfo.cs
- PeerName.cs
- ProcessThreadCollection.cs
- WebDisplayNameAttribute.cs
- EventLogInformation.cs
- CommandCollectionEditor.cs
- FrameDimension.cs
- EngineSiteSapi.cs
- LayoutInformation.cs
- GridViewRowPresenter.cs
- BamlResourceSerializer.cs
- ISCIIEncoding.cs
- MatrixIndependentAnimationStorage.cs
- MappingSource.cs
- WeakKeyDictionary.cs
- Point3DConverter.cs
- ProcessHostConfigUtils.cs
- RuntimeHandles.cs
- TreeView.cs
- DrawingGroupDrawingContext.cs
- WindowsScroll.cs
- X509UI.cs
- DataKeyCollection.cs
- FileStream.cs
- CodeAssignStatement.cs
- DayRenderEvent.cs
- MessageVersion.cs
- TypeSource.cs
- ReadOnlyCollectionBase.cs
- ButtonFieldBase.cs
- EventSourceCreationData.cs
- MbpInfo.cs
- Debug.cs
- DesigntimeLicenseContext.cs
- DescendantOverDescendantQuery.cs
- ResXFileRef.cs
- SqlUserDefinedAggregateAttribute.cs
- WindowsAuthenticationEventArgs.cs
- ProtectedProviderSettings.cs
- COM2IDispatchConverter.cs
- DispatcherOperation.cs
- shaperfactoryquerycacheentry.cs
- TableAutomationPeer.cs
- BooleanAnimationBase.cs
- Models.cs
- ToolboxBitmapAttribute.cs
- StructuralObject.cs
- InvalidOperationException.cs
- RoutingSection.cs
- CompilerParameters.cs
- RepeatBehaviorConverter.cs
- WindowsGraphics2.cs
- MenuCommands.cs
- ListCollectionView.cs
- CollectionContainer.cs
- TripleDES.cs
- XmlnsDefinitionAttribute.cs
- DiagnosticTrace.cs
- NamedObjectList.cs
- ContractValidationHelper.cs
- MappingException.cs
- DrawingContextDrawingContextWalker.cs
- SHA1CryptoServiceProvider.cs
- BitmapEffect.cs
- TraceLevelStore.cs
- WebPartExportVerb.cs
- RelationshipEnd.cs
- CodeTypeMemberCollection.cs
- InProcStateClientManager.cs
- BlobPersonalizationState.cs
- BufferModeSettings.cs
- StylusPointProperties.cs
- PassportAuthentication.cs
- GridView.cs
- TextTreeExtractElementUndoUnit.cs
- ResourceProviderFactory.cs
- EnumConverter.cs
- AsymmetricAlgorithm.cs
- OleStrCAMarshaler.cs
- WebScriptServiceHostFactory.cs
- _FtpControlStream.cs
- SubstitutionResponseElement.cs
- ReadOnlyObservableCollection.cs
- OpacityConverter.cs
- DoubleLinkListEnumerator.cs
- BindUriHelper.cs
- DocumentOrderQuery.cs
- Color.cs
- DataServiceKeyAttribute.cs
- DataObjectFieldAttribute.cs
- ToolboxItem.cs
- Polygon.cs
- PropertyGridView.cs
- MembershipPasswordException.cs
- VirtualPathUtility.cs
- XmlChildEnumerator.cs
- InvalidOperationException.cs
- PTProvider.cs
- WebEventTraceProvider.cs