private Control CreateTaskUser(int userId, IEnumerable<Task> tasks, ITaskAddableControl taskAddable) { var mc = new ctrlTimeLineRowHeaderUser(userId) { Dock = DockStyle.Top, Name = $"{nameof(ctrlTimeLineRowHeaderUser)} {userId}" }; var musrc = taskAddable.AddUser(userId); mc.BacklogMouseEnter += BacklogMouseEnter; mc.SetBacklogs(tasks, taskAddable); mc.OnExpand += (sender, args) => OnRowElaptionChanged?.Invoke(sender, args); musrc.Height = mc.Height; return mc; }
public void SetTasks(IEnumerable<Task> tasks, ITaskAddableControl taskAddable) { Controls.AddRange(tasks.Where(t => t.AssignedToId.HasValue) .GroupBy(t => t.AssignedToId.Value) .OrderBy(g => g.Key == WPSuite.ConnectedUserId) .Select(t => CreateTaskUser(t.Key, t, taskAddable)) .ToArray()); }
public void SetBacklogs(IEnumerable<Task> tasks, ITaskAddableControl taskAddable) { foreach (var mitem in tasks.GroupBy(t => new { t.BacklogId, t.Backlog.Name, t.TypeId, AssignedTo = t.AssignedToId.GetValueOrDefault(0) })) { var mc = CreateBacklogControl(mitem.Key.BacklogId, mitem.Key.AssignedTo, mitem.Key.Name, mitem.Key.TypeId); taskAddable.AddBackLog(UserId, mitem.Key.BacklogId); mc.Height = taskAddable.AddTasks(mitem, mitem.Key.BacklogId, mitem.Key.AssignedTo); pnlBacklogs.Controls.Add(mc); } }