protected override void ExecuteAction(string ribbonId) { this.StartNewUndoEntry(); Microsoft.Office.Interop.PowerPoint.Selection currentSelection = this.GetCurrentSelection(); PowerPointLabs.Models.PowerPointSlide currentSlide = this.GetCurrentSlide(); float slideHeight = this.GetCurrentPresentation().SlideHeight; float slideWidth = this.GetCurrentPresentation().SlideWidth; FillSlide.Fill(currentSelection, currentSlide, slideWidth, slideHeight); }
public static Shape Crop(PowerPointSlide currentSlide, Selection selection, double magnifyRatio = 1.0, bool isInPlace = false, bool handleError = true) { ShapeRange shapeRange = ShapeUtil.GetShapeRange(selection); Shape croppedShape = Crop(currentSlide, shapeRange, isInPlace: isInPlace, handleError: handleError); if (croppedShape != null) { croppedShape.Select(); } return(croppedShape); }
public static Shape Crop(PowerPointSlide currentSlide, Selection selection, double magnifyRatio = 1.0, bool isInPlace = false, bool handleError = true) { var shapeRange = selection.ShapeRange; if (selection.HasChildShapeRange) { shapeRange = selection.ChildShapeRange; } var croppedShape = Crop(currentSlide, shapeRange, isInPlace: isInPlace, handleError: handleError); if (croppedShape != null) { croppedShape.Select(); } return(croppedShape); }
protected override void ExecuteAction(string ribbonId) { var isButton = false; int keywordIndex; if (ribbonId.Contains(TextCollection.DynamicMenuButtonId)) { isButton = true; keywordIndex = ribbonId.IndexOf(TextCollection.DynamicMenuButtonId); feature = ribbonId.Substring(0, keywordIndex); } else { keywordIndex = ribbonId.IndexOf(TextCollection.DynamicMenuOptionId); feature = ribbonId.Substring(0, keywordIndex); } selection = this.GetCurrentSelection(); slide = this.GetCurrentSlide(); if (isButton) { if (!IsValidSelection()) { return; } var dialog = new EffectsLab.View.EffectsLabBlurrinessDialogBox(feature); dialog.SettingsHandler += PropertiesEdited; dialog.ShowDialog(); } else { var startIndex = keywordIndex + TextCollection.DynamicMenuOptionId.Length; var percentage = int.Parse(ribbonId.Substring(startIndex, ribbonId.Length - startIndex)); ExecuteBlurAction(percentage); } }
void _PowerPointApplication_WindowSelectionChange(Microsoft.Office.Interop.PowerPoint.Selection Sel) { DisplayInWatchWindow(WindowSelectionChange++, System.Reflection.MethodInfo.GetCurrentMethod().Name); }
void Application_WindowSelectionChange(Microsoft.Office.Interop.PowerPoint.Selection Sel) { //here you will delete the selected item Sel.Delete(); }
protected override bool GetEnabled(string ribbonId) { Microsoft.Office.Interop.PowerPoint.Selection currentSelection = this.GetCurrentSelection(); return(ShapeUtil.IsAllPictureOrShape(currentSelection.ShapeRange) && currentSelection.ShapeRange.Count == 1); }