Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / System / ConsoleCancelEventArgs.cs / 1305376 / 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; using System.Diagnostics.Contracts; 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 (SpecialKey == ConsoleSpecialKey.ControlBreak && value == true) throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CantCancelCtrlBreak")); Contract.EndContractBlock(); _cancel = value; } } public ConsoleSpecialKey SpecialKey { get { return _type; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- WebPartEditorOkVerb.cs
- DefaultValueConverter.cs
- Drawing.cs
- SchemaImporterExtensionElementCollection.cs
- ClassHandlersStore.cs
- LocalizeDesigner.cs
- XamlReaderHelper.cs
- ExtentCqlBlock.cs
- IssuanceLicense.cs
- ISFClipboardData.cs
- mda.cs
- WsatExtendedInformation.cs
- InternalBufferOverflowException.cs
- SecurityCriticalDataForSet.cs
- SpellerStatusTable.cs
- HttpRuntime.cs
- Nodes.cs
- RC2.cs
- ProjectionPruner.cs
- CodeDomSerializerException.cs
- SoapTransportImporter.cs
- XmlComment.cs
- SimpleWebHandlerParser.cs
- EncodingInfo.cs
- ClientRoleProvider.cs
- WmlValidatorAdapter.cs
- ZipIOZip64EndOfCentralDirectoryLocatorBlock.cs
- TableDesigner.cs
- ControllableStoryboardAction.cs
- GroupAggregateExpr.cs
- DataShape.cs
- SeverityFilter.cs
- SaveFileDialog.cs
- SecurityManager.cs
- BamlLocalizabilityResolver.cs
- SplitterEvent.cs
- ReflectPropertyDescriptor.cs
- EntityDataSourceContextDisposingEventArgs.cs
- XmlDocumentSerializer.cs
- Bidi.cs
- Authorization.cs
- DisplayMemberTemplateSelector.cs
- DetailsViewDeleteEventArgs.cs
- HMACSHA512.cs
- PathFigureCollectionValueSerializer.cs
- ProcessHostMapPath.cs
- RequestBringIntoViewEventArgs.cs
- Pipe.cs
- DiscoveryDocumentReference.cs
- ViewBase.cs
- GroupItemAutomationPeer.cs
- LogRecordSequence.cs
- XmlSchemaDatatype.cs
- Label.cs
- JobCollate.cs
- TdsParserSafeHandles.cs
- ValidateNames.cs
- DbReferenceCollection.cs
- COM2ExtendedTypeConverter.cs
- DataErrorValidationRule.cs
- ApplicationServiceManager.cs
- StoreItemCollection.cs
- ToolBarButtonClickEvent.cs
- DataObjectAttribute.cs
- DataGridViewDataErrorEventArgs.cs
- DocumentStream.cs
- DataGridViewCellFormattingEventArgs.cs
- SchemaImporterExtension.cs
- WizardForm.cs
- UnmanagedMemoryAccessor.cs
- MimeObjectFactory.cs
- EditCommandColumn.cs
- Vector.cs
- securitycriticaldataClass.cs
- PeerNameRegistration.cs
- ViewLoader.cs
- MobileListItemCollection.cs
- Funcletizer.cs
- TdsParameterSetter.cs
- CursorInteropHelper.cs
- WinCategoryAttribute.cs
- AndCondition.cs
- MimeParameterWriter.cs
- StatusBarItemAutomationPeer.cs
- Int32KeyFrameCollection.cs
- NotImplementedException.cs
- Itemizer.cs
- NetWebProxyFinder.cs
- DESCryptoServiceProvider.cs
- DictionaryGlobals.cs
- ApplicationSettingsBase.cs
- Viewport3DVisual.cs
- ToolbarAUtomationPeer.cs
- CalloutQueueItem.cs
- ComponentRenameEvent.cs
- ContentDefinition.cs
- HitTestParameters3D.cs
- selecteditemcollection.cs
- PseudoWebRequest.cs
- Version.cs