GetIndentationString() public static method

public static GetIndentationString ( IDocument document ) : string
document IDocument
return string
Exemplo n.º 1
0
        private void InsertTabs(IDocument document, ISelection selection, int y1, int y2)
        {
            string indentationString = Tab.GetIndentationString(document);

            for (int i = y2; i >= y1; i--)
            {
                LineSegment lineSegment = document.GetLineSegment(i);
                if (i != y2 || i != selection.EndPosition.Y || selection.EndPosition.X != 0)
                {
                    document.Insert(lineSegment.Offset, indentationString);
                }
            }
        }
Exemplo n.º 2
0
        private void InsertTabAtCaretPosition(TextArea textArea)
        {
            switch (textArea.Caret.CaretMode)
            {
            case CaretMode.InsertMode:
            {
                textArea.InsertString(Tab.GetIndentationString(textArea.Document, textArea));
                break;
            }

            case CaretMode.OverwriteMode:
            {
                string indentationString = Tab.GetIndentationString(textArea.Document, textArea);
                textArea.ReplaceChar(indentationString[0]);
                if (indentationString.Length <= 1)
                {
                    break;
                }
                textArea.InsertString(indentationString.Substring(1));
                break;
            }
            }
            textArea.SetDesiredColumn();
        }
Exemplo n.º 3
0
 public static string GetIndentationString(IDocument document)
 {
     return(Tab.GetIndentationString(document, null));
 }