public override void Execute(IEditorView view) { object calcResult = StepBro.Core.Main.GetService <UICalculator>().LastResult; int c = Convert.ToInt32(calcResult); for (int i = 0; i < c; i++) { view.ExecuteEditAction(m_action); } }
private void SyntaxEditor_ViewActionExecuting(object sender, EditActionEventArgs e) { if (e.Action.CanRecordInMacro) { e.Cancel = true; var repeatAction = new RepeatAction(e.Action); m_view.SyntaxEditor.Dispatcher.BeginInvoke(DispatcherPriority.Send, (DispatcherOperationCallback) delegate(object arg) { m_view.SyntaxEditor.Focus(); m_view.ExecuteEditAction(new RepeatAction(e.Action)); m_view = null; return(null); }, null); } else { m_view = null; } m_view.SyntaxEditor.ViewActionExecuting -= this.SyntaxEditor_ViewActionExecuting; // Stop waiting for action to repeat. }