Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // 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; } } } } // 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
- AliasedSlot.cs
- TextFragmentEngine.cs
- ListViewItemSelectionChangedEvent.cs
- PeerName.cs
- Empty.cs
- NetworkCredential.cs
- StructuredProperty.cs
- PrinterUnitConvert.cs
- BaseCollection.cs
- DataGridViewComboBoxEditingControl.cs
- RouteUrlExpressionBuilder.cs
- MessageQueuePermissionAttribute.cs
- FileSystemEventArgs.cs
- PrintingPermission.cs
- Trace.cs
- IRCollection.cs
- PasswordRecovery.cs
- SamlAuthenticationClaimResource.cs
- XmlNullResolver.cs
- AppSettingsExpressionBuilder.cs
- TextRunTypographyProperties.cs
- shaperfactoryquerycachekey.cs
- HtmlInputFile.cs
- PerformanceCountersElement.cs
- BamlLocalizableResourceKey.cs
- RoleManagerEventArgs.cs
- BitVec.cs
- SiteMapDataSourceView.cs
- CanonicalizationDriver.cs
- ProtocolsSection.cs
- RIPEMD160.cs
- NodeLabelEditEvent.cs
- DbParameterHelper.cs
- BitmapEffectDrawingContent.cs
- messageonlyhwndwrapper.cs
- ProbeDuplexCD1AsyncResult.cs
- EncoderFallback.cs
- RunWorkerCompletedEventArgs.cs
- XmlSchemaObjectTable.cs
- DrawingServices.cs
- WindowsGraphicsWrapper.cs
- HostedTcpTransportManager.cs
- ProfileInfo.cs
- ThreadBehavior.cs
- UriParserTemplates.cs
- WindowsFormsHelpers.cs
- SystemIPAddressInformation.cs
- OdbcFactory.cs
- ObjectViewListener.cs
- PageVisual.cs
- SqlSelectStatement.cs
- ConfigurationLocation.cs
- SettingsContext.cs
- Durable.cs
- SQLBinaryStorage.cs
- SignedPkcs7.cs
- SRDisplayNameAttribute.cs
- ResourceDictionaryCollection.cs
- _HeaderInfoTable.cs
- XmlIterators.cs
- TypeSystem.cs
- ArrangedElement.cs
- Privilege.cs
- RelatedPropertyManager.cs
- ValidationService.cs
- UserUseLicenseDictionaryLoader.cs
- DelegateInArgument.cs
- SplashScreenNativeMethods.cs
- MexTcpBindingElement.cs
- EntityDataSourceEntityTypeFilterItem.cs
- DataServiceQuery.cs
- SqlUDTStorage.cs
- ReaderContextStackData.cs
- DesignerAutoFormat.cs
- BamlWriter.cs
- CodeNamespaceImportCollection.cs
- QuaternionRotation3D.cs
- SelectionRange.cs
- BuildProvider.cs
- DataControlLinkButton.cs
- ConnectionProviderAttribute.cs
- MainMenu.cs
- BasicCellRelation.cs
- CopyAttributesAction.cs
- FixedPageStructure.cs
- ConfigViewGenerator.cs
- GetImportFileNameRequest.cs
- Math.cs
- TypeConverter.cs
- XmlSchemaComplexContentRestriction.cs
- _LoggingObject.cs
- RelativeSource.cs
- RotateTransform3D.cs
- CompositeCollection.cs
- TemplateXamlParser.cs
- sqlmetadatafactory.cs
- BamlWriter.cs
- Inline.cs
- WebBaseEventKeyComparer.cs
- CharConverter.cs