AvalonStudio.TextEditor.TextEditor.TransformSelectedLines C# (CSharp) Method

TransformSelectedLines() private method

private TransformSelectedLines ( Action transformLine ) : void
transformLine Action
return void
        private void TransformSelectedLines(Action<IDocumentLine> transformLine)
        {
            var selection = GetSelectionAsSegment();
            var lines = VisualLineGeometryBuilder.GetLinesForSegmentInDocument(TextDocument, selection);

            if (lines.Count() > 0)
            {
                var anchors = new TextSegmentCollection<TextSegment>(TextDocument);

                anchors.Add(selection);
                // TODO Add an achor to the caret index...

                TextDocument.BeginUpdate();

                foreach (var line in lines)
                {
                    transformLine(line);
                }

                TextDocument.EndUpdate();

                SetSelection(selection);
            }
        }