Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ScaleTransform.cs
- DataGridView.cs
- GridViewSelectEventArgs.cs
- LinqDataSourceView.cs
- XPathEmptyIterator.cs
- EventArgs.cs
- RegisteredScript.cs
- SerializationInfo.cs
- DynamicResourceExtension.cs
- WpfWebRequestHelper.cs
- WebRequestModulesSection.cs
- TypeResolvingOptions.cs
- MediaCommands.cs
- AddDataControlFieldDialog.cs
- ClassHandlersStore.cs
- NameSpaceExtractor.cs
- CoreSwitches.cs
- DataGridViewCellMouseEventArgs.cs
- PagesSection.cs
- BrowserInteropHelper.cs
- ListViewItem.cs
- BinaryKeyIdentifierClause.cs
- LabelInfo.cs
- AuthenticationServiceManager.cs
- ExpressionBinding.cs
- PaperSource.cs
- CodeTypeParameterCollection.cs
- ToolboxDataAttribute.cs
- InstallerTypeAttribute.cs
- LicenseManager.cs
- ArrayConverter.cs
- GeneralTransform.cs
- WsdlBuildProvider.cs
- TemplateControlBuildProvider.cs
- Panel.cs
- FilterQuery.cs
- RedistVersionInfo.cs
- DetailsViewRowCollection.cs
- XmlAutoDetectWriter.cs
- BitmapEffectDrawing.cs
- TypeConverters.cs
- ControlUtil.cs
- DoubleCollection.cs
- SettingsAttributes.cs
- MaskDesignerDialog.cs
- Hex.cs
- MemoryFailPoint.cs
- ProfileGroupSettingsCollection.cs
- CollectionBase.cs
- Aggregates.cs
- ThreadExceptionEvent.cs
- ApplicationCommands.cs
- CultureInfo.cs
- ExtendedProperty.cs
- DLinqAssociationProvider.cs
- DataTableMappingCollection.cs
- SettingsContext.cs
- HtmlTernaryTree.cs
- PreloadedPackages.cs
- AvTraceDetails.cs
- HealthMonitoringSection.cs
- IisTraceListener.cs
- Qualifier.cs
- TableCell.cs
- Propagator.Evaluator.cs
- SearchForVirtualItemEventArgs.cs
- ListViewSelectEventArgs.cs
- HandlerBase.cs
- ObfuscationAttribute.cs
- HtmlControl.cs
- RadioButtonBaseAdapter.cs
- WebPartHelpVerb.cs
- AdPostCacheSubstitution.cs
- UnsafeNativeMethods.cs
- Rijndael.cs
- FrugalMap.cs
- ServiceDesigner.cs
- SqlInternalConnection.cs
- COM2ExtendedUITypeEditor.cs
- ValidationErrorEventArgs.cs
- PropertyGeneratedEventArgs.cs
- ClientUtils.cs
- TerminatorSinks.cs
- SequentialUshortCollection.cs
- XhtmlTextWriter.cs
- LoginNameDesigner.cs
- FastEncoderStatics.cs
- IpcChannel.cs
- SqlDataSourceQueryEditor.cs
- DocumentEventArgs.cs
- DataGridViewRowHeaderCell.cs
- QueryPageSettingsEventArgs.cs
- EntityContainer.cs
- HMACSHA384.cs
- Image.cs
- SHA256CryptoServiceProvider.cs
- CssTextWriter.cs
- TreeWalker.cs
- Psha1DerivedKeyGeneratorHelper.cs
- BrowserDefinitionCollection.cs