CommentBlock() public static method

Comments selected lines or current line if range has zero length. Continues adding commentcharacter even if line is already commented. # -> ## -> ### and so on. Matches C# behavior.
public static CommentBlock ( ITextView textView, ITextBuffer textBuffer, ITextRange range, IEditorShell editorShell ) : void
textView ITextView
textBuffer ITextBuffer
range ITextRange
editorShell IEditorShell
return void
Ejemplo n.º 1
0
        public override CommandResult Invoke(Guid group, int id, object inputArg, ref object outputArg)
        {
            SnapshotSpan selectionSpan = TextView.Selection.StreamSelectionSpan.SnapshotSpan;

            RCommenter.CommentBlock(TextView, TextView.TextBuffer, new TextRange(selectionSpan.Start.Position, selectionSpan.Length), Shell.Services);
            return(CommandResult.Executed);
        }
Ejemplo n.º 2
0
        public override CommandResult Invoke(Guid group, int id, object inputArg, ref object outputArg)
        {
            var selectionSpan = TextView.Selection.StreamSelectionSpan.SnapshotSpan;

            RCommenter.CommentBlock(TextView.ToEditorView(), TextView.TextBuffer.ToEditorBuffer(),
                                    new TextRange(selectionSpan.Start.Position, selectionSpan.Length), Services.GetService <IEditorSupport>());
            return(CommandResult.Executed);
        }