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
- Effect.cs
- Viewport2DVisual3D.cs
- DocumentViewerBaseAutomationPeer.cs
- SQLDecimalStorage.cs
- ToolStripPanelCell.cs
- OracleRowUpdatedEventArgs.cs
- CharKeyFrameCollection.cs
- DateTime.cs
- BooleanFacetDescriptionElement.cs
- HandleInitializationContext.cs
- CacheEntry.cs
- InitiatorSessionSymmetricTransportSecurityProtocol.cs
- TransformerTypeCollection.cs
- TemplateColumn.cs
- JavaScriptObjectDeserializer.cs
- CatalogZoneAutoFormat.cs
- RegexMatch.cs
- ELinqQueryState.cs
- TextBoxRenderer.cs
- SQLByte.cs
- RSACryptoServiceProvider.cs
- CellCreator.cs
- JsonXmlDataContract.cs
- CursorEditor.cs
- RemotingConfiguration.cs
- EventEntry.cs
- StatusBar.cs
- EncoderExceptionFallback.cs
- HtmlWindow.cs
- WebConfigurationHostFileChange.cs
- CachedFontFamily.cs
- LogWriteRestartAreaState.cs
- ZoneButton.cs
- CodeLabeledStatement.cs
- ModelItemKeyValuePair.cs
- RegionInfo.cs
- FigureParaClient.cs
- DataQuery.cs
- TextParagraphView.cs
- SecureConversationDriver.cs
- PriorityBindingExpression.cs
- FreezableOperations.cs
- ListControl.cs
- SqlCaseSimplifier.cs
- CleanUpVirtualizedItemEventArgs.cs
- HtmlShimManager.cs
- PointCollection.cs
- SQLInt16.cs
- EllipticalNodeOperations.cs
- LifetimeServices.cs
- LineBreak.cs
- SHA1CryptoServiceProvider.cs
- ZipIOExtraFieldPaddingElement.cs
- DependencyObjectCodeDomSerializer.cs
- ChangePasswordDesigner.cs
- indexingfiltermarshaler.cs
- BinaryNode.cs
- XmlSchemaSimpleTypeRestriction.cs
- HttpResponseInternalWrapper.cs
- HtmlSelect.cs
- Container.cs
- DbBuffer.cs
- ToolStripContentPanelRenderEventArgs.cs
- PeerContact.cs
- FocusTracker.cs
- ObjectHandle.cs
- HideDisabledControlAdapter.cs
- HScrollProperties.cs
- OracleBinary.cs
- DataViewSettingCollection.cs
- ReplacementText.cs
- DataSourceXmlAttributeAttribute.cs
- FindRequestContext.cs
- OdbcPermission.cs
- BaseCAMarshaler.cs
- CookielessHelper.cs
- TextEmbeddedObject.cs
- ProxyAttribute.cs
- DataContractSet.cs
- Misc.cs
- RegexWriter.cs
- PrintDialog.cs
- Control.cs
- TableCellAutomationPeer.cs
- XmlImplementation.cs
- DBBindings.cs
- httpstaticobjectscollection.cs
- SiteMapHierarchicalDataSourceView.cs
- DataBoundLiteralControl.cs
- DocobjHost.cs
- XsdBuilder.cs
- TextControlDesigner.cs
- BlobPersonalizationState.cs
- WorkflowViewService.cs
- ConfigurationPropertyAttribute.cs
- RequestCachePolicy.cs
- SafeNativeMethods.cs
- IUnknownConstantAttribute.cs
- XmlValidatingReaderImpl.cs
- CounterSampleCalculator.cs