Registers a callback function with the token. If and when the token is canceled, the callback will be made. Note that if the token is already canceled at the point where this method is called, the callback will be made immediately and synchronously.
template< typename _Function > ::Concurrency::cancellation_token_registration register_callback( const _Function& _Func ) const;
A cancellation_token_registration object which can be utilized in the deregister method to deregister a previously registered callback and prevent it from being made. The method will throw an invalid_operation exception if it is called on a cancellation_token object that was created using the cancellation_token::none method.