C# Class NanoByte.Common.Tasks.TaskBase

Inheritance: System.MarshalByRefObject, ITask
Show file Open project: nano-byte/common

Protected Properties

Property Type Description
CancellationToken CancellationToken
CredentialProvider ICredentialProvider

Public Methods

Method Description
Run ( CancellationToken cancellationToken = default(CancellationToken), ICredentialProvider credentialProvider = null, IProgress progress = null ) : void

Protected Methods

Method Description
Execute ( ) : void

The actual code to be executed.

TaskBase ( ) : System

Private Methods

Method Description
OnProgressChanged ( ) : void

Informs the caller of the current progress, if a callback was registered.

OnProgressChangedThrottled ( ) : void

Informs the caller of the current progress, if a callback was registered. Limits the rate of progress updates.

Method Details

Execute() protected abstract method

The actual code to be executed.
The operation was canceled. The task ended with . The task ended with .
protected abstract Execute ( ) : void
return void

Run() public method

public Run ( CancellationToken cancellationToken = default(CancellationToken), ICredentialProvider credentialProvider = null, IProgress progress = null ) : void
cancellationToken CancellationToken
credentialProvider ICredentialProvider
progress IProgress
return void

TaskBase() protected method

protected TaskBase ( ) : System
return System

Property Details

CancellationToken protected property

Signaled when the user wishes to cancel the task execution.
protected CancellationToken,NanoByte.Common.Tasks CancellationToken
return CancellationToken

CredentialProvider protected property

Used to retrieve credentials for specific Uris on demand; can be null.
protected ICredentialProvider CredentialProvider
return ICredentialProvider