public bool ExecuteCommand(JoinLinesCommandArgs args, CommandExecutionContext context) { using (context.OperationContext.AddScope(allowCancellation: false, description: "Joining selected lines")) { args.TextView.TextBuffer.Insert(0, "// Invoked from modern command handler\r\n"); JoinLine.JoinSelectedLines(args.TextView, EditorOperations.GetEditorOperations(args.TextView)); } return(true); }
public int Exec(ref Guid pguidCmdGroup, uint nCmdID, uint nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut) { if (pguidCmdGroup == JoinLinesCommandSet && nCmdID == JoinLinesCommandId) { this.textView.TextBuffer.Insert(0, "// Invoked from legacy command filter\r\n"); JoinLine.JoinSelectedLines(this.textView, contextProvider.EditorOperations.GetEditorOperations(this.textView)); return(VSConstants.S_OK); } return(NextTarget.Exec(ref pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut)); }