private void Initialize(List <SampleData> ParticularData, List <JudgeUser> ParticularUser) { judgers.Clear(); CancelTasksDelegate.Clear(); JudgeUsers.Where(j => ParticularUser.Contains(j)).AsQueryable().ToList().ForEach(u => { u.Reports.Clear(); }); JudgeUsers.Where(j => ParticularUser.Contains(j)).AsQueryable().ToList().ForEach((u) => { u.Units.Where(j => ParticularData.Contains(SampleDatas.SingleOrDefault(s => s.Id == j.Id))).AsQueryable().ToList().ForEach((n) => { var j = new Judger(); j.Data = SampleDatas.Single(s => s.Id == n.Id); j.Unit = n; j.OnJudged = (sender, e) => { OnCompleteAny(); }; var report = new UserReport() { Data = j.Data, Results = j.Results }; u.Reports.Add(report); judgers.Add(j); }); }); }
public void RunByUserAndData(List <string> UserIds, List <string> DataIds) { Initialize(SampleDatas.Where(d => DataIds.Contains(d.Id)).AsQueryable().ToList(), JudgeUsers.Where(u => UserIds.Contains(u.Id)).AsQueryable().ToList()); Run(); }