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
- WebPartUserCapability.cs
- SeverityFilter.cs
- MaterializeFromAtom.cs
- ImageAutomationPeer.cs
- ScrollChrome.cs
- ContainerUIElement3D.cs
- DataException.cs
- WebPartZoneBase.cs
- SqlAggregateChecker.cs
- Ray3DHitTestResult.cs
- TextDecoration.cs
- BmpBitmapEncoder.cs
- SoapReflectionImporter.cs
- InvokePattern.cs
- TypeDescriptionProviderAttribute.cs
- FontClient.cs
- sqlser.cs
- CompiledQuery.cs
- Inline.cs
- Simplifier.cs
- xamlnodes.cs
- HtmlTable.cs
- ConditionalAttribute.cs
- NegatedCellConstant.cs
- CodeDirectiveCollection.cs
- ArraySortHelper.cs
- PackageStore.cs
- Span.cs
- CodePropertyReferenceExpression.cs
- SafeViewOfFileHandle.cs
- MdiWindowListStrip.cs
- WebPartDisplayMode.cs
- VariableQuery.cs
- Authorization.cs
- Comparer.cs
- GrammarBuilderPhrase.cs
- AssemblyInfo.cs
- RotateTransform.cs
- RtfToXamlLexer.cs
- EdmSchemaAttribute.cs
- EnterpriseServicesHelper.cs
- COSERVERINFO.cs
- EntityDataSourceDataSelection.cs
- GenericsInstances.cs
- XmlQualifiedNameTest.cs
- SQLInt16Storage.cs
- CombinedTcpChannel.cs
- XDRSchema.cs
- MessageBox.cs
- ApplicationProxyInternal.cs
- ControlPropertyNameConverter.cs
- CodeMethodInvokeExpression.cs
- Matrix3DConverter.cs
- DataTrigger.cs
- ProvidePropertyAttribute.cs
- SoapIncludeAttribute.cs
- PlatformCulture.cs
- ImportRequest.cs
- TextServicesCompartmentContext.cs
- ReadOnlyHierarchicalDataSourceView.cs
- SqlSelectStatement.cs
- CollectionType.cs
- _SslStream.cs
- DataRelationPropertyDescriptor.cs
- DriveInfo.cs
- HttpPostedFile.cs
- securitycriticaldata.cs
- XmlSchemaNotation.cs
- ScriptingWebServicesSectionGroup.cs
- ConditionalAttribute.cs
- HttpResponse.cs
- LocalTransaction.cs
- SortQuery.cs
- HexParser.cs
- HtmlTextArea.cs
- DES.cs
- XmlSchemaParticle.cs
- SrgsItemList.cs
- FontFamilyIdentifier.cs
- GroupItemAutomationPeer.cs
- activationcontext.cs
- TextSearch.cs
- WriteTimeStream.cs
- LogEntrySerialization.cs
- StrongNameMembershipCondition.cs
- ResXResourceReader.cs
- XmlChoiceIdentifierAttribute.cs
- ServiceDescriptionSerializer.cs
- WindowsFont.cs
- EpmContentSerializer.cs
- EventWaitHandle.cs
- mactripleDES.cs
- AmbientValueAttribute.cs
- JournalEntryListConverter.cs
- PersonalizationDictionary.cs
- DataGridViewComboBoxColumn.cs
- DateTimeParse.cs
- CharacterString.cs
- InternalConfigRoot.cs
- DataControlLinkButton.cs