public void ContinueProgress(ProgressNotificationId notificationId, Double progress, String message) { lock (ProgressNotificationSync) { if (Updates.Count == 0) { return; } var isActive = Updates[Updates.Count - 1].Id == notificationId; var update = isActive ? Updates[Updates.Count - 1].Clone() : Updates.Find(a => a.Id == notificationId); if (update == null) { return; } update.Message = message; update.Value = progress; if (isActive) { Updates[Updates.Count - 1] = update; OnProgressNotificationUpdated(update); } } }
internal static ProgressNotificationId Create() { var id = new ProgressNotificationId(); lock (Sync) { Prev32 += 1; id.Value = Prev32; } return(id); }
public void EndProgress(ProgressNotificationId notificationId) { if (notificationId == null) { return; } lock (ProgressNotificationSync) { Updates.RemoveAll(a => a.Id == notificationId); if (Updates.Count == 0) { OnProgressNotificationUpdated(null); } else if ((ProgressNotification != Updates[Updates.Count - 1])) { OnProgressNotificationUpdated(ProgressNotification); } } }
internal ProgressNotificationUpdate() { Id = ProgressNotificationId.Create(); }
public async void HideProgress(ProgressNotificationId notificationId, String message) { HideProgress(notificationId); await ShowProgressMessageAsync(message); }