void editingAction_ChangesMade(SlideAction obj) { String actionText = textEditor.Text; if (actionText == null) { actionText = ""; } if (actionText.Length > 33) { actionText = actionText.Substring(0, 30) + "..."; } undoBuffer.pushAndExecute(new TwoWayDelegateCommand <SlideAction, SlideAction>(CopySaver.Default.copy(currentAction), slide.getAction(currentAction.Name), new TwoWayDelegateCommand <SlideAction, SlideAction> .Funcs() { ExecuteFunc = (exec) => { notificationManager.showNotification(String.Format("Changed trigger \"{0}\" action.", actionText), PreviewIconName, 3); slide.replaceAction(exec); }, UndoFunc = (undo) => { notificationManager.showNotification(String.Format("Undid trigger \"{0}\" action.", actionText), PreviewIconName, 3); slide.replaceAction(undo); }, })); }
void slideLayoutPicker_ChangeSlideLayout(TemplateSlide newSlideLayout) { undoBuffer.pushAndExecute(new TwoWayDelegateCommand <TemplateSlide, TemplateSlide>(newSlideLayout, slide.createTemplateSlide(editorController.ResourceProvider), new TwoWayDelegateCommand <TemplateSlide, TemplateSlide> .Funcs() { ExecuteFunc = editorController.applySlideLayout, UndoFunc = editorController.applySlideLayout, })); }
private void EditingAction_ChangesMade(SlideAction obj) { undoBuffer.pushAndExecute(new TwoWayDelegateCommand <SlideAction, SlideAction>(CopySaver.Default.copy(currentAction), slide.getAction(currentAction.Name), new TwoWayDelegateCommand <SlideAction, SlideAction> .Funcs() { ExecuteFunc = (exec) => { notificationManager.showNotification("Changed slider action.", PreviewIconName, 3); slide.replaceAction(exec); }, UndoFunc = (undo) => { notificationManager.showNotification("Changed slider action.", PreviewIconName, 3); slide.replaceAction(undo); }, })); }