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
- _ListenerRequestStream.cs
- DateTimeFormatInfo.cs
- DynamicMethod.cs
- PermissionSetTriple.cs
- AlternateView.cs
- CodeGotoStatement.cs
- PropertyValue.cs
- ScrollItemPatternIdentifiers.cs
- HTTPNotFoundHandler.cs
- validation.cs
- PackagingUtilities.cs
- PopupRootAutomationPeer.cs
- AssemblyContextControlItem.cs
- Unit.cs
- TextElementCollectionHelper.cs
- InOutArgumentConverter.cs
- DebuggerAttributes.cs
- CodePropertyReferenceExpression.cs
- XsdValidatingReader.cs
- ScalarOps.cs
- NavigationExpr.cs
- DetailsViewModeEventArgs.cs
- DataColumnChangeEvent.cs
- FrameworkContentElementAutomationPeer.cs
- RegexWorker.cs
- StickyNoteHelper.cs
- XamlLoadErrorInfo.cs
- HtmlInputReset.cs
- SspiHelper.cs
- PropertyIDSet.cs
- ErrorInfoXmlDocument.cs
- activationcontext.cs
- VBIdentifierDesigner.xaml.cs
- SimpleHandlerBuildProvider.cs
- CreateUserWizardStep.cs
- PageClientProxyGenerator.cs
- TextEncodedRawTextWriter.cs
- WindowsContainer.cs
- TdsParserSafeHandles.cs
- ListViewTableRow.cs
- XmlCountingReader.cs
- TextLine.cs
- DataViewSettingCollection.cs
- UpdateExpressionVisitor.cs
- GrammarBuilderPhrase.cs
- EndOfStreamException.cs
- ProgressBarHighlightConverter.cs
- EditCommandColumn.cs
- WinEventHandler.cs
- NullableDecimalAverageAggregationOperator.cs
- KeyEvent.cs
- typedescriptorpermissionattribute.cs
- SynchronizedKeyedCollection.cs
- X509Certificate2Collection.cs
- ResourcesGenerator.cs
- EntityCollection.cs
- XmlCDATASection.cs
- KnownTypesHelper.cs
- PagesSection.cs
- log.cs
- LinkTarget.cs
- DmlSqlGenerator.cs
- AsyncPostBackTrigger.cs
- ComboBox.cs
- RegexMatchCollection.cs
- HtmlAnchor.cs
- COM2PropertyBuilderUITypeEditor.cs
- PropertySegmentSerializationProvider.cs
- CompatibleComparer.cs
- RtfControls.cs
- KnownBoxes.cs
- AvTraceFormat.cs
- HostVisual.cs
- AttachInfo.cs
- DesignerDataSourceView.cs
- SQLBoolean.cs
- WebPartMenu.cs
- LabelLiteral.cs
- DataBoundControlHelper.cs
- TrackBarRenderer.cs
- ShapeTypeface.cs
- GPRECT.cs
- FamilyTypefaceCollection.cs
- SqlConnectionPoolGroupProviderInfo.cs
- Line.cs
- CodeMethodMap.cs
- NoneExcludedImageIndexConverter.cs
- Figure.cs
- FontUnitConverter.cs
- TimeSpan.cs
- SigningCredentials.cs
- PerformanceCounterManager.cs
- NavigatingCancelEventArgs.cs
- CommandManager.cs
- safelink.cs
- HtmlWindowCollection.cs
- pingexception.cs
- DynamicValueConverter.cs
- ValidatingPropertiesEventArgs.cs
- AssemblyHash.cs