Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion xml/System/Console.xml
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@

- <xref:System.ConsoleCancelEventArgs.SpecialKey%2A>, which allows you to determine whether the handler was invoked as a result of the user pressing Ctrl+C (the property value is <xref:System.ConsoleSpecialKey.ControlC?displayProperty=nameWithType>) or Ctrl+Break (the property value is <xref:System.ConsoleSpecialKey.ControlBreak?displayProperty=nameWithType>).

- <xref:System.ConsoleCancelEventArgs.Cancel%2A>, which allows you to determine how to your application should respond to the user pressing Ctrl+C or Ctrl+Break. By default, the <xref:System.ConsoleCancelEventArgs.Cancel%2A> property is `false`, which causes program execution to terminate when the event handler exits. Changing its property to `true` specifies that the application should continue to execute.
- <xref:System.ConsoleCancelEventArgs.Cancel%2A>, which allows you to determine how your application should respond to the user pressing Ctrl+C or Ctrl+Break. By default, the <xref:System.ConsoleCancelEventArgs.Cancel%2A> property is `false`, which causes program execution to terminate when the event handler exits. Changing its property to `true` specifies that the application should continue to execute.

> [!TIP]
> If your application has simple requirements, you can use the <xref:System.Console.TreatControlCAsInput%2A> property instead of this event. By setting this property to `false`, you can ensure that your application always exits if the user presses Ctrl+C. By setting it to `true`, you can ensure that pressing Ctrl+C will not terminate the application.
Expand Down