Пример #1
0
        public void ConstructList()
        {
            SuspendLayout();
            for (var i = Controls.Count - 1; i >= 0; --i)
            {
                if (Controls[i] is GroupHeaderItem)
                {
                    Controls[i].Dispose();
                }
            }
            Controls.Clear();

            var height = 0;
            IterableStepGroup prevGroup = null;

            for (var i = 0; i < _stepControls.Count; ++i)
            {
                var scc = _stepControls[i];
                if (scc.Step.Iterations != -1)
                {
                    var currentGroup = StepManager.GetGroupByIndex(i);
                    if (currentGroup != prevGroup)
                    {
                        Controls.Add(new GroupHeaderItem(currentGroup)
                        {
                            Width    = Width,
                            Location = new Point(0, height - VerticalScroll.Value)
                        });
                        height += GroupHeaderItem.HeightValue;
                    }
                    prevGroup = currentGroup;
                }
                scc.Index    = i;
                scc.Width    = Width;
                scc.Location = new Point(0, height - VerticalScroll.Value);
                height      += StepItem.HeightValue;
                Controls.Add(scc);
            }
            ResumeLayout(true);
        }