Class MultiTaskTracker
A tracker that tracks the status of multiple tasks at once and provides a summarized view of the progress of all tasks being tracked
Inheritance
Implements
Inherited Members
Namespace: LemonEdge.Client.Core.Tasks
Assembly: ClientCore.dll
Syntax
public class MultiTaskTracker : ITaskStatusDisplayer
Properties
CurrentStatus
Returns status of the task if tracking one task, otherwise returns Running
Declaration
public ServerTaskStatus CurrentStatus { get; }
Property Value
Type | Description |
---|---|
ServerTaskStatus |
Header
Returns header of the task if tracking one task, otherwise returns "Processing Parallel Tasks"
Declaration
public string Header { get; }
Property Value
Type | Description |
---|---|
System.String |
MaxProgressIndex
Throws an error, not used by a multipl task tracker
Declaration
public short MaxProgressIndex { get; }
Property Value
Type | Description |
---|---|
System.Int16 |
Name
Returns name of the task if tracking one task, otherwise returns ""
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
System.String |
RunningOnServer
Returns false if any of the tasks are running locally, true otherwise
Declaration
public bool RunningOnServer { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
ServerTaskID
Returns id of the task if tracking one task, otherwise returns null
Declaration
public Guid? ServerTaskID { get; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Guid> |
Tasks
A list of all the tasks being tracked
Declaration
public IEnumerable<ITaskStatusDisplayer> Tasks { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<ITaskStatusDisplayer> |
TasksTracked
Returns the total number of internal tasks being tracked
Declaration
public short TasksTracked { get; }
Property Value
Type | Description |
---|---|
System.Int16 |
TimeRunning
Returns the total time running if tracking one task, otherwise returns "Multiple Tasks"
Declaration
public string TimeRunning { get; }
Property Value
Type | Description |
---|---|
System.String |
Tooltip
A user friendly tooltip for the currently tracked task containing header info, status and the percentage progress
Declaration
public string Tooltip { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Methods
Cancel()
Cancels the task if tracking 1 task, otherwise throws an error
Declaration
public Task Cancel()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A task indicating the completion of the operation |
GetAllMessages(TaskMessageType)
Throws an error, not used by a multipl task tracker
Declaration
public Task<IEnumerable<ITaskMessage>> GetAllMessages(TaskMessageType type)
Parameters
Type | Name | Description |
---|---|---|
TaskMessageType | type |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<ITaskMessage>> |
GetAllProgressMesssages(Int16)
Throws an error, not used by a multipl task tracker
Declaration
public Task<IEnumerable<ITaskMessage>> GetAllProgressMesssages(short progressIndex = 0)
Parameters
Type | Name | Description |
---|---|---|
System.Int16 | progressIndex |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<ITaskMessage>> |
GetCurrentProgress(Int16)
Returns the average of the current progress across all tasks being internally tracked
Declaration
public decimal GetCurrentProgress(short progressIndex = 0)
Parameters
Type | Name | Description |
---|---|---|
System.Int16 | progressIndex | The index of the progress to report |
Returns
Type | Description |
---|---|
System.Decimal | The average of the current progress across all tasks being internally tracked |
GetProgressCurrentMessage(Int16)
Returns message of the task if tracking one task, otherwise returns "Avg Progress"
Declaration
public string GetProgressCurrentMessage(short progressIndex = 0)
Parameters
Type | Name | Description |
---|---|---|
System.Int16 | progressIndex |
Returns
Type | Description |
---|---|
System.String |
StopTrackingTask(ITaskStatusDisplayer)
Informs the tracker to stop tracking the specified task and remove it from the list of tasks being tracked
Declaration
public void StopTrackingTask(ITaskStatusDisplayer taskTracker)
Parameters
Type | Name | Description |
---|---|---|
ITaskStatusDisplayer | taskTracker | The task to stop tracking and remove from the list of tasks being tracked |
TrackTask(ITaskStatusDisplayer)
Creates a new multiple task tracker with the specified initial task being tracked
Declaration
public void TrackTask(ITaskStatusDisplayer taskTracker)
Parameters
Type | Name | Description |
---|---|---|
ITaskStatusDisplayer | taskTracker | The initial task being tracked by this multiple task tracker |
Events
OnStatusChanged
Indicates the status of any of the tasks being tracked has changed, so the UI has chance to reflect this
Declaration
public event EventHandler<EventArgs> OnStatusChanged
Event Type
Type | Description |
---|---|
System.EventHandler<System.EventArgs> |