Ejemplo n.º 1
0
        public void Execute(MacroEntry macro)
        {
            if (macro.IsBackground)
            {
                if (macro.IsRunning)
                {
                    macro.Stop();
                }
                else
                {
                    macro.Execute();
                }
            }
            else
            {
                if (CurrentMacro != null && CurrentMacro.IsRunning)
                {
                    if (macro == CurrentMacro && macro.DoNotAutoInterrupt)
                    {
                        return;
                    }

                    CurrentMacro.Stop();
                }

                CurrentMacro = macro;
                CurrentMacro.Execute();
            }
        }
Ejemplo n.º 2
0
 public void Stop(string name = null)
 {
     if (string.IsNullOrEmpty(name))
     {
         CurrentMacro?.Stop();
     }
     else
     {
         MacroEntry macro = Items.FirstOrDefault(m => m.Name.ToLower().Equals(name.ToLower()));
         macro?.Stop();
     }
 }