CancellationScope Activity Designer

Applies to: yesVisual Studio noVisual Studio for Mac

Note

This article applies to Visual Studio 2017. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

The CancellationScope activity designer is used to create and configure a CancellationScope activity.

The CancellationScope Activity

The CancellationScope activity allows you to specify an activity for execution and cancellation logic for that activity.

Using the CancellationScope Activity Designer

The CancellationScope activity designer can be found in the Transaction category of Toolbox. To open Toolbox, select the Toolbox tab of the Workflow Designer. Alternatively, select Toolbox from the View menu, or press Ctrl+Alt+X.

The CancellationScope activity designer can be dragged from Toolbox and dropped on to the Workflow Designer surface wherever activities are placed, such as inside a Sequence. Dropping the CancellationScope activity designer creates a CancellationScope activity with a default DisplayName of CancellationScope. Edit the DisplayName value in the header of the CancellationScope activity designer. You can also edit it in the DisplayName box of the property grid.

The CancellationScope Properties

The following table shows the CancellationScope properties and describes how they are used in the designer. The DisplayName property can be edited in property grid but the other properties must be edited on Workflow Designer surface.

Property Name Required Usage
DisplayName False The optional friendly name of the CancellationScope activity. The default is CancellationScope. Although the DisplayName value is not strictly required, it is a best practice to use one.
Body True Specifies the activity for which cancellation logic is provided. To add the Body activity, drop an activity from Toolbox into the Body box on the CancellationScope activity designer. Add the hint text "Drop Activity Here".
CancellationHandler True Specifies the activity that is executed if there's a cancellation. To add the CancellationHandler activity, drop an activity from Toolbox into the CancellationHandler box on the CancellationScope activity designer. Add the hint text "Drop Activity Here".

See also