private void createDiscussionBoxes(IEnumerable <Discussion> discussions) { foreach (Discussion discussion in discussions) { if (!SystemFilter.DoesMatchFilter(discussion)) { continue; } SingleDiscussionAccessor accessor = Shortcuts.GetSingleDiscussionAccessor( _gitLabInstance, _modificationListener, _mergeRequestKey, discussion.Id); DiscussionBox box = new DiscussionBox(this, accessor, _git, _currentUser, _mergeRequestKey.ProjectKey, discussion, _mergeRequestAuthor, _diffContextDepth, _colorScheme, // pre-content-change (sender) => { SuspendLayout(); sender.Visible = false; // to avoid flickering on repositioning }, // post-content-change (sender, lite) => { // 'lite' means that there were no a preceding PreContentChange event, so we did not suspend layout updateLayout(null, true, lite); updateSearch(); _onDiscussionModified?.Invoke(); }, sender => MostRecentFocusedDiscussionControl = sender) { // Let new boxes be hidden to avoid flickering on repositioning Visible = false }; Controls.Add(box); } }
private void createDiscussionBoxes(List <Discussion> discussions) { foreach (var discussion in discussions) { if (!SystemFilter.DoesMatchFilter(discussion)) { continue; } DiscussionEditor editor = _manager.GetDiscussionEditor(_mergeRequestDescriptor, discussion.Id); DiscussionBox box = new DiscussionBox(discussion, editor, _mergeRequestAuthor, _currentUser, _diffContextDepth, _gitRepository, _colorScheme, (sender) => { SuspendLayout(); sender.Visible = false; // to avoid flickering on repositioning }, (sender) => updateLayout(null)) { // Let new boxes be hidden to avoid flickering on repositioning Visible = false }; Controls.Add(box); } }