FormatString() public method

public FormatString ( Mono.TextEditor.DocumentLocation loc, string str ) : string
loc Mono.TextEditor.DocumentLocation
str string
return string
Example #1
0
            public string GetVirtualSpaces(int lineNumber, int column)
            {
                string indent = GetIndent(lineNumber, column);

                if (column == indent.Length + 1)
                {
                    return(data.FormatString(0, indent));
                }
                return("");
            }
		public void Insert (TextEditorData editor, string text)
		{
			int offset = editor.Document.LocationToOffset (Location);
			editor.Document.BeginAtomicUndo ();
			text = editor.FormatString (Location, text);
			
			LineSegment line = editor.Document.GetLineByOffset (offset);
			int insertionOffset = line.Offset + Location.Column - 1;
			offset = insertionOffset;
			InsertNewLine (editor, LineBefore, ref offset);
			
			offset += editor.Insert (offset, text);
			InsertNewLine (editor, LineAfter, ref offset);
			editor.Document.EndAtomicUndo ();
		}
		public void Insert (TextEditorData editor, string text)
		{
			int offset = editor.Document.LocationToOffset (Location);
			using (var undo = editor.OpenUndoGroup ()) {
				text = editor.FormatString (Location, text);
				
				LineSegment line = editor.Document.GetLineByOffset (offset);
				int insertionOffset = line.Offset + Location.Column - 1;
				offset = insertionOffset;
				InsertNewLine (editor, LineBefore, ref offset);
				
				offset += editor.Insert (offset, text);
				InsertNewLine (editor, LineAfter, ref offset);
			}
		}
Example #4
0
        public void Insert(TextEditorData editor, string text)
        {
            int offset = editor.Document.LocationToOffset(Location);

            using (var undo = editor.OpenUndoGroup()) {
                text = editor.FormatString(Location, text);

                DocumentLine line            = editor.Document.GetLineByOffset(offset);
                int          insertionOffset = line.Offset + Location.Column - 1;
                offset = insertionOffset;
                InsertNewLine(editor, LineBefore, ref offset);

                offset += editor.Insert(offset, text);
                InsertNewLine(editor, LineAfter, ref offset);
            }
        }
        public void Insert(TextEditorData editor, string text)
        {
            int offset = editor.Document.LocationToOffset(Location);

            editor.Document.BeginAtomicUndo();
            text = editor.FormatString(Location, text);

            LineSegment line            = editor.Document.GetLineByOffset(offset);
            int         insertionOffset = line.Offset + Location.Column - 1;

            offset = insertionOffset;
            InsertNewLine(editor, LineBefore, ref offset);

            offset += editor.Insert(offset, text);
            InsertNewLine(editor, LineAfter, ref offset);
            editor.Document.EndAtomicUndo();
        }