protected override void ExecuteAction(string ribbonId)
        {
            this.StartNewUndoEntry();
            PowerPointPresentation pres  = this.GetCurrentPresentation();
            PowerPointSlide        slide = this.GetCurrentSlide();
            Selection selection          = this.GetCurrentSelection();

            CustomTaskPane shapesLabPane = this.GetTaskPane(typeof(CustomShapePane));

            if (shapesLabPane == null)
            {
                this.RegisterTaskPane(typeof(CustomShapePane), ShapesLabText.TaskPanelTitle);
                shapesLabPane = this.GetTaskPane(typeof(CustomShapePane));
            }
            if (shapesLabPane == null)
            {
                return;
            }
            shapesLabPane.Visible = true;

            CustomShapePane customShapePane = shapesLabPane.Control as CustomShapePane;

            customShapePane.InitCustomShapePaneStorage();
            customShapePane.AddShapeFromSelection(selection);
        }
Пример #2
0
 public void OpenPane()
 {
     UIThreadExecutor.Execute(() =>
     {
         Globals.ThisAddIn.Ribbon.CustomShapeButtonClick(
             new RibbonControl("ShapesLab"));
         _pane = Globals.ThisAddIn.GetActivePane(
             typeof(CustomShapePane)).Control as CustomShapePane;
     });
 }
 public void OpenPane()
 {
     UIThreadExecutor.Execute(() =>
     {
         FunctionalTestExtensions.GetRibbonUi().CustomShapeButtonClick(
             new RibbonControl("ShapesLab"));
         _pane = FunctionalTestExtensions.GetTaskPane(
             typeof(CustomShapePane)).Control as CustomShapePane;
     });
 }
 public void OpenPane()
 {
     UIThreadExecutor.Execute(() =>
     {
         Globals.ThisAddIn.Ribbon.CustomShapeButtonClick(
             new RibbonControl("ShapesLab"));
         _pane = Globals.ThisAddIn.GetActivePane(
             typeof(CustomShapePane)).Control as CustomShapePane;
     });
 }
Пример #5
0
 public void OpenPane()
 {
     UIThreadExecutor.Execute((Action)(() =>
     {
         FunctionalTestExtensions.GetRibbonUi().OnAction(
             new RibbonControl(ShapesLabText.PaneTag));
         _pane = FunctionalTestExtensions.GetTaskPane(
             typeof(CustomShapePane)).Control as CustomShapePane;
     }));
 }
Пример #6
0
 public void OpenPane()
 {
     UIThreadExecutor.Execute(() =>
     {
         FunctionalTestExtensions.GetRibbonUi().CustomShapeButtonClick(
             new RibbonControl("ShapesLab"));
         _pane = FunctionalTestExtensions.GetTaskPane(
             typeof(CustomShapePane)).Control as CustomShapePane;
     });
 }
        protected override void ExecuteAction(string ribbonId)
        {
            CustomShapePane customShape = InitCustomShapePane();
            Selection       selection   = this.GetCurrentSelection();
            ThisAddIn       addIn       = this.GetAddIn();

            customShape.AddShapeFromSelection(selection, addIn);

            SetPaneVisibility(true);
        }
Пример #8
0
        protected override void ExecuteAction(string ribbonId)
        {
            this.RegisterTaskPane(typeof(CustomShapePane), ShapesLabText.TaskPanelTitle);
            CustomTaskPane shapesLabPane = this.GetTaskPane(typeof(CustomShapePane));

            if (shapesLabPane == null)
            {
                return;
            }

            // toggle pane visibility
            shapesLabPane.Visible = !shapesLabPane.Visible;

            CustomShapePane customShapePane = shapesLabPane.Control as CustomShapePane;

            customShapePane.InitCustomShapePaneStorage();
        }
        public void SetPaneVisibility(bool visibility)
        {
            CustomTaskPane customShapePane = GetShapesLabPane();

            if (customShapePane == null)
            {
                return;
            }

            customShapePane.Visible = visibility;

            if (customShapePane.Visible)
            {
                CustomShapePane customShape = customShapePane.Control as CustomShapePane;
                customShape.Width = customShapePane.Width - 16;
                customShape.PaneReload();
            }
        }
        public CustomShapePane InitCustomShapePane()
        {
            ThisAddIn addIn = this.GetAddIn();

            addIn.InitializeShapesLabConfig();
            addIn.InitializeShapeGallery();
            addIn.RegisterShapesLabPane(this.GetCurrentPresentation().Presentation);

            CustomTaskPane customShapePane = GetShapesLabPane();

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

            CustomShapePane customShape = customShapePane.Control as CustomShapePane;

            Logger.Log(
                "Before Visible: " +
                string.Format("Pane Width = {0}, Pane Height = {1}, Control Width = {2}, Control Height {3}",
                              customShapePane.Width, customShapePane.Height, customShape.Width, customShape.Height));

            return(customShape);
        }