protected override ShapeRange ExecutePasteAction(string ribbonId, PowerPointPresentation presentation, PowerPointSlide slide,
                                                         ShapeRange selectedShapes, ShapeRange selectedChildShapes)
        {
            if (selectedShapes.Count <= 0)
            {
                MessageBox.Show(TextCollection.PasteLabText.ReplaceWithClipboardActionHandlerReminderText, TextCollection.CommonText.ErrorTitle);
                return(null);
            }

            ShapeRange pastingShapes = ClipboardUtil.PasteShapesFromClipboard(slide);

            if (pastingShapes == null)
            {
                return(null);
            }

            return(ReplaceWithClipboard.Execute(presentation, slide, selectedShapes, selectedChildShapes, pastingShapes));
        }
Esempio n. 2
0
        protected override ShapeRange ExecutePasteAction(string ribbonId, PowerPointPresentation presentation, PowerPointSlide slide,
                                                         ShapeRange selectedShapes, ShapeRange selectedChildShapes)
        {
            if (selectedShapes.Count <= 0)
            {
                MessageBox.Show("Please select at least one shape.", "Error");
                return(null);
            }

            ShapeRange pastingShapes = PasteShapesFromClipboard(slide);

            if (pastingShapes == null)
            {
                return(null);
            }

            return(ReplaceWithClipboard.Execute(presentation, slide, selectedShapes, selectedChildShapes, pastingShapes));
        }
Esempio n. 3
0
        protected override ShapeRange ExecutePasteAction(string ribbonId, PowerPointPresentation presentation, PowerPointSlide slide,
                                                         ShapeRange selectedShapes, ShapeRange selectedChildShapes)
        {
            if (selectedShapes.Count <= 0)
            {
                MessageBox.Show(TextCollection.PasteLabText.ReplaceWithClipboardActionHandlerReminderText, TextCollection.CommonText.ErrorTitle);
                return(null);
            }

            this.StartNewUndoEntry();

            ShapeRange pastingShapes = ClipboardUtil.PasteShapesFromClipboard(presentation, slide);

            if (pastingShapes == null)
            {
                Logger.Log("PasteLab: Could not paste clipboard contents.");
                MessageBox.Show(PasteLabText.ErrorPaste, PasteLabText.ErrorDialogTitle);
                return(null);
            }

            return(ReplaceWithClipboard.Execute(presentation, slide, selectedShapes, selectedChildShapes, pastingShapes));
        }