示例#1
0
        public async Task <PasteItemsResult> PasteItemsAsync(IEnumerable <ICopyPasteItem> items, DropEffects effect)
        {
            Assumes.NotNull(_dropTarget);

            ImmutableHashSet <string> previousIncludes = await OrderingHelper.GetAllEvaluatedIncludes(_configuredProject, _accessor);

            PasteItemsResult result = await PasteHandler.PasteItemsAsync(items, effect);

            await OrderingHelper.Move(_configuredProject, _accessor, previousIncludes, _dropTarget !, OrderingMoveAction.MoveToTop);

            return(result);
        }
        public async Task HintingAsync(IProjectChangeHint hint)
        {
            // This will only be called once even if you are adding multiple files from say, e.g. add existing item dialog
            // However we check to see if we captured the previous includes for sanity to ensure it only gets set once.
            if (CanMove() && _previousIncludes.IsEmpty)
            {
                ConfiguredProject configuredProject = hint.UnconfiguredProject.Services.ActiveConfiguredProjectProvider.ActiveConfiguredProject;

                _previousIncludes = await OrderingHelper.GetAllEvaluatedIncludes(configuredProject, _accessor).ConfigureAwait(false);

                _isHinting = true;
            }
        }
示例#3
0
        public async Task <PasteItemsResult> PasteItemsAsync(IEnumerable <ICopyPasteItem> items, DropEffects effect)
        {
            Assumes.NotNull(_dropTarget);

            // ConfigureAwait is true because we need to come back for PasteItemsAsync to work. If not, PasteItemsAsync will throw.
            ImmutableHashSet <string> previousIncludes = await OrderingHelper.GetAllEvaluatedIncludes(_configuredProject, _accessor).ConfigureAwait(true);

            PasteItemsResult result = await PasteHandler.PasteItemsAsync(items, effect).ConfigureAwait(false);

            await OrderingHelper.Move(_configuredProject, _accessor, previousIncludes, _dropTarget, OrderingMoveAction.MoveToTop).ConfigureAwait(false);

            return(result);
        }