Пример #1
0
        public bool ExecuteCommand(MoveLastCaretDownCommandArgs args, CommandExecutionContext executionContext)
        {
            var broker = args.TextView.GetMultiSelectionBroker();

            if (broker.HasMultipleSelections)
            {
                Selection toRemove    = FindLastSelection(broker);
                var       addNextArgs = new InsertNextMatchingCaretCommandArgs(args.TextView, args.SubjectBuffer);
                if (ExecuteCommand(addNextArgs, executionContext))
                {
                    if (broker.TryRemoveSelection(toRemove))
                    {
                        return(broker.TryEnsureVisible(FindLastSelection(broker), EnsureSpanVisibleOptions.None));
                    }
                }
            }

            return(false);
        }
Пример #2
0
        public CommandState GetCommandState(MoveLastCaretDownCommandArgs args)
        {
            var broker = args.TextView.GetMultiSelectionBroker();

            return(broker.HasMultipleSelections && !broker.PrimarySelection.IsEmpty ? CommandState.Available : CommandState.Unavailable);
        }