private static void UpdateStatusHeader(Toggle toggle, Progress.Status status, int[] countPerStatus) { var countStr = countPerStatus[(int)status].ToString(); if (toggle.text != countStr) { toggle.text = countStr; } }
private static int CompareStatus(Progress.Status statusSource, Progress.Status statusToCompare) { // Pause and Running have the same priority (we don't want the item to change position when clicking pause/resume) if ((statusSource == Progress.Status.Running || statusSource == Progress.Status.Paused) && (statusToCompare != Progress.Status.Running && statusToCompare != Progress.Status.Paused)) { return(1); } if (statusSource == Progress.Status.Failed && (statusToCompare != Progress.Status.Failed && statusToCompare != Progress.Status.Running && statusToCompare != Progress.Status.Paused)) { return(1); } if (statusSource == Progress.Status.Canceled && statusToCompare == Progress.Status.Succeeded) { return(1); } if (statusSource == statusToCompare // Same thing, Pause and Running have the same priority (we don't want the item to change position when clicking pause/resume) || (statusSource == Progress.Status.Running || statusSource == Progress.Status.Paused) && (statusToCompare == Progress.Status.Running || statusToCompare == Progress.Status.Paused)) { return(0); } return(-1); }
public void Finish(Progress.Status status = Progress.Status.Succeeded) { Progress.Finish(Id, status); }