Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / ndp / clr / src / BCL / System / ConsoleCancelEventArgs.cs / 2 / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DataView.cs
- WebHttpElement.cs
- NumericExpr.cs
- CodeAttributeArgumentCollection.cs
- GridItem.cs
- EventBuilder.cs
- CachedResourceDictionaryExtension.cs
- ProtocolsConfiguration.cs
- ProfilePropertySettings.cs
- Point3DAnimationBase.cs
- MethodCallExpression.cs
- SchemaImporter.cs
- WebUtil.cs
- SqlAliasesReferenced.cs
- TypeProvider.cs
- NotifyInputEventArgs.cs
- PolicyStatement.cs
- TimeZoneInfo.cs
- BoolExpressionVisitors.cs
- AdRotator.cs
- ListItemParagraph.cs
- Authorization.cs
- Brush.cs
- CollectionViewSource.cs
- TextSelectionProcessor.cs
- DesignDataSource.cs
- LOSFormatter.cs
- EventsTab.cs
- ExitEventArgs.cs
- SelectionItemProviderWrapper.cs
- XmlNodeWriter.cs
- CultureData.cs
- filewebresponse.cs
- MonthChangedEventArgs.cs
- Int32Converter.cs
- HttpCapabilitiesBase.cs
- MediaElement.cs
- AssemblyCollection.cs
- OrthographicCamera.cs
- BoundingRectTracker.cs
- SystemInformation.cs
- Label.cs
- precedingsibling.cs
- RectAnimation.cs
- NullableConverter.cs
- StyleReferenceConverter.cs
- TextLineResult.cs
- DataServiceBuildProvider.cs
- Operator.cs
- SymbolDocumentInfo.cs
- PolicyStatement.cs
- UInt32Storage.cs
- fixedPageContentExtractor.cs
- RestHandler.cs
- PassportPrincipal.cs
- SelectiveScrollingGrid.cs
- ZipFileInfo.cs
- TemplateControlCodeDomTreeGenerator.cs
- ConstraintCollection.cs
- DBCSCodePageEncoding.cs
- SmiSettersStream.cs
- ChameleonKey.cs
- SecurityDescriptor.cs
- RelationalExpressions.cs
- BorderGapMaskConverter.cs
- ErrorHandlerFaultInfo.cs
- DataGridBeginningEditEventArgs.cs
- MachineKeyConverter.cs
- MachineSettingsSection.cs
- HashStream.cs
- DataGridViewImageCell.cs
- CatchBlock.cs
- DefaultTraceListener.cs
- _ServiceNameStore.cs
- LinkLabel.cs
- SlipBehavior.cs
- NamespaceQuery.cs
- NumericUpDownAccelerationCollection.cs
- _NestedSingleAsyncResult.cs
- SafeFileMapViewHandle.cs
- GregorianCalendar.cs
- TextTreeTextNode.cs
- PowerModeChangedEventArgs.cs
- HttpListenerRequest.cs
- UnsafeNativeMethods.cs
- TdsValueSetter.cs
- DataServiceQueryOfT.cs
- UrlAuthFailedErrorFormatter.cs
- SamlAssertion.cs
- TypeGeneratedEventArgs.cs
- XmlStreamStore.cs
- EmbeddedObject.cs
- ConfigurationProperty.cs
- DataGridColumnCollectionEditor.cs
- HtmlContainerControl.cs
- DataGridTablesFactory.cs
- StatusStrip.cs
- LinqDataSourceSelectEventArgs.cs
- EventLogger.cs
- TableStyle.cs