Ejemplo n.º 1
0
        public async Task <PasteItemsResult> PasteItemsAsync(IEnumerable <ICopyPasteItem> items, DropEffects effect)
        {
            Assumes.NotNull(_dropTarget);

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

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

            await OrderingHelper.MoveAsync(_configuredProject.Value, _accessor, previousIncludes, _dropTarget, OrderingMoveAction.MoveToTop);

            return(result);
        }
Ejemplo n.º 2
0
        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)
            {
                Assumes.Present(hint.UnconfiguredProject.Services.ActiveConfiguredProjectProvider);
                ConfiguredProject?configuredProject = hint.UnconfiguredProject.Services.ActiveConfiguredProjectProvider.ActiveConfiguredProject;
                Assumes.NotNull(configuredProject);
                _previousIncludes = await OrderingHelper.GetAllEvaluatedIncludesAsync(configuredProject, _accessor);

                _isHinting = true;
            }
        }