C# Class GSF.Threading.CompatibleCancellationToken

Inheritance: ICancellationToken
Show file Open project: GridProtectionAlliance/gsf Class Usage Examples

Public Methods

Method Description
Cancel ( ) : bool

Cancels the operation.

The token can only be cancelled if a CancellationTokenSource was provided.

CompatibleCancellationToken ( CancellationToken token ) : System

Creates a CompatibleCancellationToken based on an existing GSF cancellation token.

GetToken ( ) : CancellationToken

Gets a System.Threading.CancellationToken associated with this CompatibleCancellationToken.

GetTokenSource ( ) : CancellationTokenSource

Gets a CancellationTokenSource associated with this CompatibleCancellationToken.

This function will return null when the CompatibleCancellationToken was created from an existing system cancellation token and not its source or a GSF cancellation token.

Private Methods

Method Description
CompatibleCancellationToken ( CancellationTokenSource source ) : System
CompatibleCancellationToken ( System token ) : System

Method Details

Cancel() public method

Cancels the operation.
The token can only be cancelled if a CancellationTokenSource was provided.
not available, token cannot be cancelled.
public Cancel ( ) : bool
return bool

CompatibleCancellationToken() public method

Creates a CompatibleCancellationToken based on an existing GSF cancellation token.
public CompatibleCancellationToken ( CancellationToken token ) : System
token System.Threading.CancellationToken Existing GSF token.
return System

GetToken() public method

Gets a System.Threading.CancellationToken associated with this CompatibleCancellationToken.
public GetToken ( ) : CancellationToken
return System.Threading.CancellationToken

GetTokenSource() public method

Gets a CancellationTokenSource associated with this CompatibleCancellationToken.
This function will return null when the CompatibleCancellationToken was created from an existing system cancellation token and not its source or a GSF cancellation token.
public GetTokenSource ( ) : CancellationTokenSource
return System.Threading.CancellationTokenSource