| | | 1 | | namespace Elsa.Workflows; |
| | | 2 | | |
| | | 3 | | /// <summary> |
| | | 4 | | /// Provides contextual information about a signal. |
| | | 5 | | /// </summary> |
| | | 6 | | public class SignalContext |
| | | 7 | | { |
| | | 8 | | /// <summary> |
| | | 9 | | /// Initializes a new instance of the <see cref="SignalContext"/> class. |
| | | 10 | | /// </summary> |
| | 12182 | 11 | | public SignalContext(ActivityExecutionContext receiverActivityExecutionContext, ActivityExecutionContext senderActiv |
| | | 12 | | { |
| | 12182 | 13 | | ReceiverActivityExecutionContext = receiverActivityExecutionContext; |
| | 12182 | 14 | | SenderActivityExecutionContext = senderActivityExecutionContext; |
| | 12182 | 15 | | CancellationToken = cancellationToken; |
| | 12182 | 16 | | } |
| | | 17 | | |
| | | 18 | | /// <summary> |
| | | 19 | | /// The <see cref="ActivityExecutionContext"/> receiving the signal. |
| | | 20 | | /// </summary> |
| | 24358 | 21 | | public ActivityExecutionContext ReceiverActivityExecutionContext { get; init; } |
| | | 22 | | |
| | | 23 | | /// <summary> |
| | | 24 | | /// The <see cref="ActivityExecutionContext"/> sending the signal. |
| | | 25 | | /// </summary> |
| | 24359 | 26 | | public ActivityExecutionContext SenderActivityExecutionContext { get; init; } |
| | | 27 | | |
| | | 28 | | /// <summary> |
| | | 29 | | /// Returns true if the receiver is the same as the sender. |
| | | 30 | | /// </summary> |
| | 0 | 31 | | public bool IsSelf => SenderActivityExecutionContext.Activity == ReceiverActivityExecutionContext.Activity; |
| | | 32 | | |
| | | 33 | | /// <summary> |
| | | 34 | | /// The cancellation token. |
| | | 35 | | /// </summary> |
| | 14721 | 36 | | public CancellationToken CancellationToken { get; init; } |
| | | 37 | | |
| | 12185 | 38 | | internal bool StopPropagationRequested { get; private set; } |
| | | 39 | | |
| | | 40 | | /// <summary> |
| | | 41 | | /// Stops the signal from propagating further up the activity execution context hierarchy. |
| | | 42 | | /// </summary> |
| | 3 | 43 | | public void StopPropagation() => StopPropagationRequested = true; |
| | | 44 | | } |