void Command_Macro_Append_Quick(int quickNum) { if (RecordingMacro == null) { RecordingMacro = Macro.Load(QuickMacro(quickNum), true); } else { Command_Macro_Record_StopRecording(QuickMacro(quickNum)); } }
void Command_Macro_Play_PlayOnCopiedFiles() { var files = new Queue <string>(NEClipboard.Current.Strings); var macro = Macro.Load(); Action startNext = null; startNext = () => { if (!files.Any()) { return; } Add(files.Dequeue()); macro.Play(this, playing => MacroPlaying = playing, startNext); }; startNext(); }
void Command_Macro_Play_Repeat() { var result = MacroPlayRepeatDialog.Run(WindowParent, Macro.ChooseMacro); if (result == null) { return; } var macro = Macro.Load(result.Macro); var expression = new NEExpression(result.Expression); var count = int.MaxValue; if (result.RepeatType == MacroPlayRepeatDialog.RepeatTypeEnum.Number) { count = expression.Evaluate <int>(); } Action startNext = null; startNext = () => { if ((TopMost == null) || (--count < 0)) { return; } if (result.RepeatType == MacroPlayRepeatDialog.RepeatTypeEnum.Condition) { if (!expression.Evaluate <bool>(TopMost.GetVariables())) { return; } } macro.Play(this, playing => MacroPlaying = playing, startNext); }; startNext(); }
void Command_Macro_Play_Play() => Macro.Load().Play(this, playing => MacroPlaying = playing);
void Command_Macro_Play_Quick(int quickNum) => Macro.Load(QuickMacro(quickNum), true).Play(this, playing => MacroPlaying = playing);
void Command_Macro_Append_Append() { ValidateNoCurrentMacro(); RecordingMacro = Macro.Load(); }