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
- SmtpLoginAuthenticationModule.cs
- SynchronizedPool.cs
- RpcResponse.cs
- RegionData.cs
- PanningMessageFilter.cs
- Freezable.cs
- ServiceMemoryGates.cs
- MediaPlayerState.cs
- SpellCheck.cs
- LinearKeyFrames.cs
- PageContentCollection.cs
- ComponentConverter.cs
- SemanticBasicElement.cs
- OletxResourceManager.cs
- Point4D.cs
- XpsInterleavingPolicy.cs
- Int32RectConverter.cs
- HitTestResult.cs
- IMembershipProvider.cs
- HwndSource.cs
- DrawListViewSubItemEventArgs.cs
- StringDictionaryWithComparer.cs
- ServiceChannelManager.cs
- EntityDataSourceReferenceGroup.cs
- TemplateEditingService.cs
- HttpClientChannel.cs
- MatrixTransform.cs
- NavigationHelper.cs
- ThicknessAnimationUsingKeyFrames.cs
- DecimalAnimationUsingKeyFrames.cs
- NativeMethodsOther.cs
- DbgCompiler.cs
- TableLayoutPanelCellPosition.cs
- ColumnBinding.cs
- PageTrueTypeFont.cs
- SecurityDescriptor.cs
- SqlGatherConsumedAliases.cs
- GridViewRowEventArgs.cs
- itemelement.cs
- TagElement.cs
- SystemPens.cs
- CheckBoxAutomationPeer.cs
- ContractMapping.cs
- EntityViewContainer.cs
- WebResourceAttribute.cs
- EntityDataSourceWizardForm.cs
- SvcMapFileSerializer.cs
- RegistryConfigurationProvider.cs
- RegionIterator.cs
- PaperSource.cs
- ComponentCodeDomSerializer.cs
- ReferenceSchema.cs
- Sequence.cs
- VisualStateGroup.cs
- XmlSchemaFacet.cs
- TextServicesCompartmentContext.cs
- TextSearch.cs
- Rotation3DAnimationBase.cs
- XmlHierarchicalEnumerable.cs
- RecordBuilder.cs
- ExpressionBuilderCollection.cs
- ProfileSettingsCollection.cs
- DataGridViewSelectedCellCollection.cs
- ActiveXHost.cs
- MeasureItemEvent.cs
- PasswordRecoveryAutoFormat.cs
- ConsoleTraceListener.cs
- X509Chain.cs
- XPathNode.cs
- DeclarativeCatalogPartDesigner.cs
- XmlSortKey.cs
- InputBindingCollection.cs
- RIPEMD160Managed.cs
- SafeLibraryHandle.cs
- EDesignUtil.cs
- StackBuilderSink.cs
- DriveInfo.cs
- SpeakCompletedEventArgs.cs
- MappedMetaModel.cs
- Int32Storage.cs
- BitmapFrameEncode.cs
- AttributeCollection.cs
- WrappedReader.cs
- PropertyValueChangedEvent.cs
- TypeForwardedToAttribute.cs
- SqlDataSourceCommandEventArgs.cs
- SqlConnection.cs
- TrackingStringDictionary.cs
- MasterPageBuildProvider.cs
- BrowserCapabilitiesFactory.cs
- JavascriptCallbackBehaviorAttribute.cs
- TemplateBaseAction.cs
- MailMessageEventArgs.cs
- UnsafeCollabNativeMethods.cs
- HeaderUtility.cs
- SafeHandle.cs
- ValidationPropertyAttribute.cs
- UIAgentAsyncEndRequest.cs
- ResXResourceReader.cs
- AnnouncementInnerClientCD1.cs