## CancellationToken::Register method


Registers a callback that will be invoked when cancellation is requested.

```cpp
CancellationTokenRegistration System::Threading::CancellationToken::Register(const Action<> &callback) const
```


| Parameter | Type | Description |
| --- | --- | --- |
| callback | const Action<>\& | The [Action<>](../../../system/action/) to execute when cancellation is requested. |

### ReturnValue

A [CancellationTokenRegistration](../../cancellationtokenregistration/) object that can be used to deregister the callback.
## Remarks



If cancellation has already been requested, the callback will be invoked immediately. 

## See Also

* Class [CancellationTokenRegistration](../../cancellationtokenregistration/)
* Typedef [Action](../../../system/action/)
* Class [CancellationToken](../)
* Namespace [System::Threading](../../)
* Library [Aspose.TeX for C++](../../../)
