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
- OracleTimeSpan.cs
- XslAst.cs
- MetaModel.cs
- ResourceCategoryAttribute.cs
- ApplicationServicesHostFactory.cs
- WindowsRebar.cs
- SystemNetHelpers.cs
- TextEffectResolver.cs
- InertiaTranslationBehavior.cs
- Rule.cs
- COM2PropertyDescriptor.cs
- WorkflowCreationContext.cs
- TypeBuilderInstantiation.cs
- SQLCharsStorage.cs
- CellParagraph.cs
- PropertySourceInfo.cs
- SafeRegistryHandle.cs
- PromptStyle.cs
- localization.cs
- XmlChoiceIdentifierAttribute.cs
- ExtendedPropertyCollection.cs
- OlePropertyStructs.cs
- OSFeature.cs
- ExpressionList.cs
- InheritablePropertyChangeInfo.cs
- QueueAccessMode.cs
- CheckBoxFlatAdapter.cs
- CheckPair.cs
- ImageAnimator.cs
- XmlChildNodes.cs
- XmlNodeChangedEventManager.cs
- Codec.cs
- HttpAsyncResult.cs
- XmlSchemaInclude.cs
- InvalidCastException.cs
- FlagsAttribute.cs
- ListViewPagedDataSource.cs
- InvalidEnumArgumentException.cs
- SelectionItemProviderWrapper.cs
- Socket.cs
- hresults.cs
- DataObjectFieldAttribute.cs
- XhtmlConformanceSection.cs
- GeometryModel3D.cs
- ColumnMapTranslator.cs
- DynamicAttribute.cs
- ImageList.cs
- MethodBuilder.cs
- MimeWriter.cs
- InputMethodStateChangeEventArgs.cs
- GlobalProxySelection.cs
- DataGrid.cs
- X509KeyIdentifierClauseType.cs
- QuadraticBezierSegment.cs
- BaseDataBoundControlDesigner.cs
- ColorBlend.cs
- InternalResources.cs
- WizardForm.cs
- ReferenceEqualityComparer.cs
- CodeSnippetStatement.cs
- DataRecord.cs
- RegexStringValidatorAttribute.cs
- RepeaterItem.cs
- Compiler.cs
- DataSourceCache.cs
- ServicePoint.cs
- Overlapped.cs
- CallbackValidatorAttribute.cs
- filewebresponse.cs
- FormViewCommandEventArgs.cs
- Object.cs
- DynamicDataExtensions.cs
- smtpconnection.cs
- Compiler.cs
- TabControlCancelEvent.cs
- StrongNameMembershipCondition.cs
- MethodCallExpression.cs
- CodeMemberEvent.cs
- DataStreams.cs
- ArrayEditor.cs
- XmlConvert.cs
- StringComparer.cs
- CryptoStream.cs
- OverflowException.cs
- PnrpPeerResolverBindingElement.cs
- ActivityDesignerHelper.cs
- ReadOnlyTernaryTree.cs
- SqlCommandSet.cs
- RequestChannelBinder.cs
- OleDbFactory.cs
- SqlTriggerAttribute.cs
- RightsManagementUser.cs
- BaseResourcesBuildProvider.cs
- Zone.cs
- DtrList.cs
- SmiRecordBuffer.cs
- RangeBaseAutomationPeer.cs
- SpellerStatusTable.cs
- TextDecorationCollection.cs
- PasswordBox.cs