Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- interface ITask
- {
- int TotalWork; // ProgressMax
- event Progresschanged; // Notifies of the current progress
- event ProgressComplete;
- }
- struct Task { int work, progress }
- class OverallProgress
- {
- List<Task> tasks;
- int Work { get { return tasks.Sum(t=>t.work; } }
- int Progress { get { return tasks.Sum(t=>t.progress/t.work); } }
- void AddTask(Task t) { tasks.Add(t); }
- }
Add Comment
Please, Sign In to add comment