xtd - Reference Guide  0.1.0
Modern c++17 framework to create console, gui and unit test applications on Windows, macOS and Linux.
xtd::console_cancel_event_args Class Referencefinal

Provides data for the console::cancel_key_press event. This class cannot be inherited. More...

#include <console_cancel_event_args.h>

Inheritance diagram for xtd::console_cancel_event_args:
xtd::event_args

Public Member Functions

 console_cancel_event_args ()=default
 Initializes a new instance of the console_cancel_event_args class. More...
 
 console_cancel_event_args (bool cancel, console_special_key special_key)
 Initializes a new instance of the console_cancel_event_args class. More...
 
bool cancel () const
 Gets a value that indicates whether simultaneously pressing the Control modifier key and the C console key (Ctrl+C) or the Ctrl+Break keys terminates the current process. The default is false, which terminates the current process. More...
 
void cancel (bool cancel)
 Sets a value that indicates whether simultaneously pressing the Control modifier key and the C console key (Ctrl+C) or the Ctrl+Break keys terminates the current process. The default is false, which terminates the current process. More...
 
console_special_key special_key () const
 Gets the combination of modifier and console keys that interrupted the current process. More...
 

Static Public Attributes

static const event_args empty
 Provides a value to use with events that do not have event data. More...
 

Detailed Description

Provides data for the console::cancel_key_press event. This class cannot be inherited.

Remarks
A user can interrupt a console application process by simultaneously pressing the Control modifier key and the C console key (Ctrl+C), or the Control modifier key and the Break console key (Ctrl+Break). The console consequently provides a console_cancel_event_args object to the event handler for the console::cancel_key_press event to specify whether the process should be cancelled.
If the cancel property is set to true in the event handler, the process is resumed; otherwise, the process is terminated. By default, the value of the console_cancel_event_args property is false, and the process terminates.

The documentation for this class was generated from the following file: