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

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

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

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

            return(result);
        }
        public async Task HintedAsync(IImmutableDictionary <Guid, IImmutableSet <IProjectChangeHint> > hints)
        {
            if (CanMove() && !_previousIncludes.IsEmpty && hints.ContainsKey(ProjectChangeFileSystemEntityHint.AddedFile))
            {
                IProjectChangeHint hint = hints[ProjectChangeFileSystemEntityHint.AddedFile].First();
                ConfiguredProject  configuredProject = hint.UnconfiguredProject.Services.ActiveConfiguredProjectProvider.ActiveConfiguredProject;
                await OrderingHelper.Move(configuredProject, _accessor, _previousIncludes, _target, _action).ConfigureAwait(false);
            }

            // Reset everything because we are done.
            // We need to make sure these are all reset so we can listen for changes again.
            Reset();
        }
Exemple #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);
        }