Beispiel #1
0
        public void CurrentSelectionToIterableGroup()
        {
            if (MarkedControls.Count == 0)
            {
                return;
            }
            var min = _stepControls.Count;
            var max = -1;

            for (var i = 0; i < MarkedControls.Count; ++i)
            {
                if (MarkedControls[i].Index < min)
                {
                    min = MarkedControls[i].Index;
                }
                if (MarkedControls[i].Index > max)
                {
                    max = MarkedControls[i].Index;
                }
                MarkedControls[i]
                .Step.MakeIterable(ArrayExpressionEditor.Items.Count > 1
                        ? ArrayExpressionEditor.Len
                        : 2);
                MarkedControls[i].RespectIterable();
            }
            if (max + 1 == StepManager.Steps.Count)
            {
                StepManager.Insert(new EmptyStep(), max + 1, false, null, false, true);
            }
            StepManager.IterableGroups.Add(new IterableStepGroup(ArrayExpressionEditor.Items.Count > 1
                ? string.Format("len({0})", ArrayExpressionEditor.Items[0].Expr.FullName)
                : "2")
            {
                StartIndex = min,
                Length     = max - min + 1
            });
            ClearMarked();
            ConstructList();
            StepManager.RefreshToCurrentStep();
        }