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
- PerformanceCounter.cs
- dsa.cs
- XdrBuilder.cs
- ContextInformation.cs
- EraserBehavior.cs
- UIElement3D.cs
- AppSettingsExpressionEditor.cs
- DataServiceQuery.cs
- FlowLayoutPanelDesigner.cs
- PagePropertiesChangingEventArgs.cs
- NativeMethods.cs
- ImageConverter.cs
- XmlSchemaComplexContentExtension.cs
- Automation.cs
- PersonalizationStateQuery.cs
- ParallelEnumerableWrapper.cs
- TimelineCollection.cs
- RegistryHandle.cs
- ObjectSet.cs
- AmbientLight.cs
- Vector3DValueSerializer.cs
- Dynamic.cs
- storepermission.cs
- CodeParameterDeclarationExpression.cs
- InputLangChangeRequestEvent.cs
- FileLevelControlBuilderAttribute.cs
- DataControlField.cs
- Sorting.cs
- HandlerBase.cs
- X509UI.cs
- SimpleApplicationHost.cs
- CodeObjectCreateExpression.cs
- TextParagraphView.cs
- CompoundFileStorageReference.cs
- EntityProviderServices.cs
- MatrixAnimationUsingKeyFrames.cs
- ValidationHelper.cs
- WorkflowViewManager.cs
- SettingsPropertyValueCollection.cs
- TableLayoutPanelBehavior.cs
- ContentType.cs
- QilCloneVisitor.cs
- XmlnsDictionary.cs
- ImageSourceValueSerializer.cs
- InternalControlCollection.cs
- WebPartCloseVerb.cs
- XmlTextAttribute.cs
- MeshGeometry3D.cs
- XmlSchemaInclude.cs
- PartitionedDataSource.cs
- StringConverter.cs
- TemplateBindingExpression.cs
- CodeThrowExceptionStatement.cs
- UserControlParser.cs
- TextServicesManager.cs
- Queue.cs
- XsdDataContractImporter.cs
- IIS7UserPrincipal.cs
- SqlVisitor.cs
- SetIterators.cs
- TreeIterators.cs
- CodeCommentStatement.cs
- TraceListener.cs
- DecimalAnimationBase.cs
- OleDbParameter.cs
- DataGridViewSelectedCellsAccessibleObject.cs
- UInt64Storage.cs
- SQLDouble.cs
- TreeWalkHelper.cs
- Profiler.cs
- LoginUtil.cs
- XPathSingletonIterator.cs
- XmlDocumentFragment.cs
- TableHeaderCell.cs
- PropertyBuilder.cs
- RemoteWebConfigurationHostServer.cs
- OutOfProcStateClientManager.cs
- CachedPathData.cs
- DataTableReaderListener.cs
- XmlElementList.cs
- AssertFilter.cs
- WebServiceEnumData.cs
- CommandID.cs
- TypeLoadException.cs
- KoreanCalendar.cs
- ReliabilityContractAttribute.cs
- DataGridViewCellEventArgs.cs
- BaseCollection.cs
- ObjectListCommandCollection.cs
- PenLineCapValidation.cs
- DocumentViewer.cs
- ComboBoxRenderer.cs
- XhtmlTextWriter.cs
- ResXBuildProvider.cs
- MD5HashHelper.cs
- DataGridItemEventArgs.cs
- Annotation.cs
- MessageSecurityOverMsmq.cs
- TemplateKey.cs
- UnknownWrapper.cs