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
- XmlTypeMapping.cs
- LazyTextWriterCreator.cs
- BidOverLoads.cs
- ValueTypeFixupInfo.cs
- KnownBoxes.cs
- odbcmetadatacolumnnames.cs
- WindowsSpinner.cs
- DataGridViewComboBoxEditingControl.cs
- EdmProperty.cs
- CellNormalizer.cs
- CodeIdentifier.cs
- FamilyTypeface.cs
- ImageBrush.cs
- Interlocked.cs
- RC2CryptoServiceProvider.cs
- GraphicsState.cs
- SafeCryptHandles.cs
- AddingNewEventArgs.cs
- DetailsViewInsertedEventArgs.cs
- EntityStoreSchemaGenerator.cs
- ValidationHelpers.cs
- DesignerInterfaces.cs
- EntityDataSourceQueryBuilder.cs
- XmlIlGenerator.cs
- FlowDocumentScrollViewer.cs
- EntityConnectionStringBuilder.cs
- PropertyFilter.cs
- EntityDataSourceWrapperCollection.cs
- ToggleButtonAutomationPeer.cs
- SoapIgnoreAttribute.cs
- ImageListUtils.cs
- ModifiableIteratorCollection.cs
- UpWmlPageAdapter.cs
- SpecialNameAttribute.cs
- CompilerError.cs
- SmiXetterAccessMap.cs
- ScrollViewer.cs
- FlowNode.cs
- OracleBoolean.cs
- StructuredProperty.cs
- FormatStringEditor.cs
- MenuItemCollection.cs
- ReflectionTypeLoadException.cs
- IndexedEnumerable.cs
- Resources.Designer.cs
- EntityUtil.cs
- ReadOnlyDataSourceView.cs
- ValidationSummary.cs
- SqlInternalConnectionTds.cs
- BrushValueSerializer.cs
- InvalidOleVariantTypeException.cs
- DataBindingExpressionBuilder.cs
- HttpModulesSection.cs
- RadioButtonDesigner.cs
- FlowDocumentReader.cs
- DataRowCollection.cs
- WebPartPersonalization.cs
- ZipIOFileItemStream.cs
- PersonalizationProviderHelper.cs
- _NetRes.cs
- CalendarButtonAutomationPeer.cs
- PersonalizationEntry.cs
- MimeParameters.cs
- InputScopeConverter.cs
- Variable.cs
- EventProxy.cs
- TemplateControlParser.cs
- TextFormatter.cs
- Pair.cs
- XmlDownloadManager.cs
- Cell.cs
- AggregationMinMaxHelpers.cs
- IPAddressCollection.cs
- SqlWebEventProvider.cs
- ClientTargetSection.cs
- CompilerParameters.cs
- CustomCategoryAttribute.cs
- TableLayoutSettings.cs
- MemberCollection.cs
- EntityModelSchemaGenerator.cs
- DiscardableAttribute.cs
- BinaryConverter.cs
- PostBackOptions.cs
- Msmq3PoisonHandler.cs
- TableRowCollection.cs
- COM2FontConverter.cs
- FormatConvertedBitmap.cs
- SequentialUshortCollection.cs
- SQLByteStorage.cs
- ContentElement.cs
- SQLDateTimeStorage.cs
- DesignSurface.cs
- WorkflowInlining.cs
- BuiltInPermissionSets.cs
- CngKeyCreationParameters.cs
- _AutoWebProxyScriptWrapper.cs
- baseaxisquery.cs
- MiniMapControl.xaml.cs
- SafeCryptContextHandle.cs
- SerializationHelper.cs