Code:
/ DotNET / DotNET / 8.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
- UrlMapping.cs
- XPathSelfQuery.cs
- SubclassTypeValidator.cs
- RequiredFieldValidator.cs
- KeyboardDevice.cs
- SubstitutionList.cs
- DataGridViewBand.cs
- AuthorizationRule.cs
- EnumType.cs
- AddingNewEventArgs.cs
- BitmapMetadataEnumerator.cs
- ConsoleTraceListener.cs
- CuspData.cs
- XmlSchemaSubstitutionGroup.cs
- WriteableOnDemandPackagePart.cs
- GatewayDefinition.cs
- Decorator.cs
- DataGridViewElement.cs
- WebPartDeleteVerb.cs
- AuthenticationServiceManager.cs
- TextBox.cs
- KeyedHashAlgorithm.cs
- VarRefManager.cs
- AnnotationService.cs
- HTTPNotFoundHandler.cs
- Size.cs
- SizeAnimationBase.cs
- shaperfactory.cs
- WorkflowTransactionOptions.cs
- SchemaMerger.cs
- FormViewInsertEventArgs.cs
- EmbeddedMailObject.cs
- AuthenticateEventArgs.cs
- DataGridViewLinkColumn.cs
- X509ChainPolicy.cs
- Point3DConverter.cs
- ReflectionUtil.cs
- XhtmlTextWriter.cs
- QilSortKey.cs
- Int64Storage.cs
- Axis.cs
- RijndaelManagedTransform.cs
- IsolatedStorageFile.cs
- BlurBitmapEffect.cs
- HttpHostedTransportConfiguration.cs
- SchemaComplexType.cs
- BaseCodeDomTreeGenerator.cs
- GroupAggregateExpr.cs
- ContentOperations.cs
- CssStyleCollection.cs
- XmlSchemaExternal.cs
- listitem.cs
- LocalFileSettingsProvider.cs
- RadioButtonFlatAdapter.cs
- QueryOperationResponseOfT.cs
- Debug.cs
- XmlCharCheckingReader.cs
- TraceUtils.cs
- EventListenerClientSide.cs
- RowUpdatingEventArgs.cs
- HelpKeywordAttribute.cs
- InputLanguageProfileNotifySink.cs
- TypeBuilder.cs
- PropertyChangedEventArgs.cs
- EventProvider.cs
- XmlHelper.cs
- EventData.cs
- StructuralComparisons.cs
- SuppressMergeCheckAttribute.cs
- _FtpDataStream.cs
- Debug.cs
- WebEventCodes.cs
- SafeNativeMethodsMilCoreApi.cs
- ObservableDictionary.cs
- TemplateParser.cs
- PlanCompilerUtil.cs
- BeginCreateSecurityTokenRequest.cs
- EntityDataSourceWrapper.cs
- GotoExpression.cs
- OutputScopeManager.cs
- columnmapkeybuilder.cs
- SmiEventSink.cs
- OrderingExpression.cs
- PropertyBuilder.cs
- GrabHandleGlyph.cs
- FactoryGenerator.cs
- glyphs.cs
- StringPropertyBuilder.cs
- SqlRowUpdatingEvent.cs
- RenamedEventArgs.cs
- MobileErrorInfo.cs
- EntityType.cs
- EventManager.cs
- TextSelectionHelper.cs
- VirtualDirectoryMapping.cs
- Resources.Designer.cs
- Wildcard.cs
- FormatConvertedBitmap.cs
- ReadOnlyDataSource.cs
- TextParaClient.cs