public ctrlGroupEdit(Group group) { _group = group; }
private ListViewItem CreateGroupRow(Group group) { return new ListViewItem(group.Name) { Tag = group.Id, SubItems = { string.Join(", ", _data.UserInGroups .Where(uig => uig.UserId == group.Id) .Join(_data.Users, uid => uid.UserId, u => u.Id, (uid, g) => g) .GroupBy(g => g.Id) .Select(g => g.First().Name) .Take(10)) } }; }
public static void ShowGroupEdit(Group group, Func<Group, Task> afterSave = null) { var mc = new ctrlGroupEdit(group); mc.AfterSave = async g => { if (afterSave != null) await afterSave(g); mc.ParentForm?.Close(); }; ShowControlInForm(mc, ShowInFormControlSize.ControlSize); }