private static void Set(Guid id, AmazonProgressModel progressModel) { if (ProgressBars.Keys.Contains(id)) { ProgressBars[id] = progressModel; } }
public static AmazonProgressModel Get(Guid?id) { var currentProgress = new AmazonProgressModel(); if (id.HasValue) { currentProgress = ProgressBars.Keys.Contains(id.Value) ? ProgressBars[id.Value] : new AmazonProgressModel(); } return(currentProgress); }
public static object GetStatus(Guid?id) { var currentProgress = new AmazonProgressModel(); if (id.HasValue) { currentProgress = ProgressBars.Keys.Contains(id.Value) ? ProgressBars[id.Value] : new AmazonProgressModel(); } return(new { currentProgress.PercentComplete, Status = currentProgress.Messages.Any()?currentProgress.Messages.Last().Stage:String.Empty }); }