private void Awake() { Instance = this; ProgressDictionary.Add(1, (0, 50)); ProgressDictionary.Add(2, (50, 250)); ProgressDictionary.Add(3, (250, 500)); ProgressDictionary.Add(4, (500, 1000)); ProgressDictionary.Add(5, (1000, 1500)); ProgressDictionary.Add(6, (1500, 2500)); ProgressDictionary.Add(7, (2500, 5000)); ProgressDictionary.Add(8, (5000, 7500)); ProgressDictionary.Add(9, (7500, 10000)); }
public void UpdateProgress(ISingleFile file, double progress) { int fileCount = ProgressDictionary.Count; if (ProgressDictionary.ContainsKey(file)) { ProgressDictionary[file] = progress; } double totalProgress = ProgressDictionary.Values.Sum(); Application.Current.Dispatcher.Invoke(() => { Progress = (totalProgress / fileCount) * 100; }); }