Exemplo n.º 1
0
        protected override ShapeRange ExecutePasteAction(string ribbonId, PowerPointPresentation presentation, PowerPointSlide slide,
                                                         ShapeRange selectedShapes, ShapeRange selectedChildShapes)
        {
            if (selectedShapes.Count <= 0)
            {
                Logger.Log("PasteIntoGroup failed. No valid shape is selected.");
                return(null);
            }

            if (selectedShapes.Count == 1 && !ShapeUtil.IsAGroup(selectedShapes[1]))
            {
                Logger.Log("PasteIntoGroup failed. Selection is only a single shape.");
                return(null);
            }

            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(PasteIntoGroup.Execute(presentation, slide, selectedShapes, pastingShapes));
        }
        protected override ShapeRange ExecutePasteAction(string ribbonId, PowerPointPresentation presentation, PowerPointSlide slide,
                                                         ShapeRange selectedShapes, ShapeRange selectedChildShapes)
        {
            if (selectedShapes.Count <= 0)
            {
                Logger.Log("PasteIntoGroup failed. No valid shape is selected.");
                return(null);
            }

            if (selectedShapes.Count == 1 && !ShapeUtil.IsAGroup(selectedShapes[1]))
            {
                Logger.Log("PasteIntoGroup failed. Selection is only a single shape.");
                return(null);
            }

            ShapeRange pastingShapes = PasteShapesFromClipboard(slide);

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

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