Пример #1
0
 /// <summary>Sends using Gidei unless 'enclosed' or &lt;?new&gt; is encountered.  If delay is not specified then the KeyDelay property is used.
 /// This checks the focus is not in SAW before sending to SendKeys</summary>
 public void SendKeys(string text, int delay = -1)
 {
     //if (FindForm().Focused) this seems to be true spuriously at time;  this may be better:
     if (Windows.GetForegroundWindow().Equals(FindForm().Handle))
     {
         frmFocusWarning.Display();
     }
     else
     {
         try
         {
             if (delay < 0)
             {
                 delay = KeyDelay;
             }
             KeySend.Instance.SendStringKeys(text, delay);
         }
         catch (UserException e) when(!Globals.Root.IsDebug)
         {
             MessageBox.Show(e.Message);
         }
     }
 }