コード例 #1
0
        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);
        }
コード例 #2
0
        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));
        }