public static void SyncRemoveCategory(ThisAddIn addIn, int removedCategoryIndex) { if (addIn == null) { return; } foreach (PowerPoint.DocumentWindow window in Globals.ThisAddIn.Application.Windows) { if (window == addIn.Application.ActiveWindow) { continue; } CustomShapePane shapePaneControl = (addIn.GetControlFromWindow(typeof(CustomShapePane), window) as CustomShapePane); shapePaneControl?.RemoveCategory(removedCategoryIndex); } }
public static void SyncShapeAdd(ThisAddIn addIn, string shapeName, string shapeFullName, string category) { if (addIn == null) { return; } foreach (PowerPoint.DocumentWindow window in Globals.ThisAddIn.Application.Windows) { if (window == addIn.Application.ActiveWindow) { continue; } CustomShapePane shapePaneControl = (addIn.GetControlFromWindow(typeof(CustomShapePane), window) as CustomShapePane); if (shapePaneControl?.CurrentCategory == category) { shapePaneControl.AddCustomShape(shapeName, shapeFullName, false); } } }