Class AsyncTaskProgress
Class AsyncTaskProgress
Namespace: Aspose.Imaging.AsyncTask
Assembly: Aspose.Imaging.dll (25.7.0)
Provides progress info for the asynchronous task.
public class AsyncTaskProgress
{
private int _progress;
private Task<int> _task;
public AsyncTaskProgress(Task<int> task)
{
_task = task;
}
public void SetProgress(int progress)
{
_progress = progress;
}
public int GetProgress()
{
return _progress;
}
public async Task<int> GetCompletedTaskProgressAsync()
{
await _task;
return _progress;
}
}
Inheritance
Inherited Members
object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Constructors
AsyncTaskProgress(int, TimeSpan)
Initializes a new instance of the Aspose.Imaging.AsyncTask.AsyncTaskProgress class.
public async Task Progress(int progressPercentage, TimeSpan duration)
{
}
Parameters
progressPercentage
int
The progress percentage.
duration
TimeSpan
The duration.
Fields
Duration
The duration of the asynchronous task.
public readonly TimeSpan Duration
{
get;
}
Field Value
ProgressPercentage
The progress of the asynchronous task, in percent.
public readonly int ProgressPercentage
{
get;
private set;
}