LitDev.LDTextWindow.Read C# (CSharp) Method

Read() public static method

Read from a TextWindow with a maximum delay. This sends a Return (ENTER) to the TextWindow after the delay. If the user presses Return before the delay is completed, then no further action is taken.
public static Read ( Primitive delay ) : Primitive
delay Primitive A maximum delay in ms before the Read is terminated.
return Primitive
        public static Primitive Read(Primitive delay)
        {
            try
            {
                Thread thread = new Thread(Delay);
                thread.Start((int)delay);
                Primitive result = TextWindow.Read();
                thread.Abort();
                return result;
            }
            catch (Exception ex)
            {
                Utilities.OnError(Utilities.GetCurrentMethod(), ex);
            }
            return "";
        }