This is probably something simple but I can't seem to find the answer. I am trying to use the WaitForAsync method with a TelnetTerminalControl. I am building my ScriptEvent array as per below and I get an error that it is not an array when I receive the callback. How do I build an array of ScriptEvent? Also, I am running in a headless mode, purely screen scraping, at what point should I consider all of a screen complete? Should I be polling for text or perhaps use tControl.Screen.GetRegionText?
Thank you in advance!
private void Test()
{
ScriptEvent[] searchText = new ScriptEvent[]
{
ScriptEvent.TextAtPosition("Test", 0, 0)
};
tControl.WaitForAsync(searchText, asyncWaitCompleted);
}
// Error = {"Unable to cast object of type 'ComponentPro.Net.Terminal.ScriptEvent' to type 'ComponentPro.Net.Terminal.ScriptEvent[]'."}
private void asyncWaitCompleted(Object obj, System.ComponentModel.AsyncCompletedEventArgs eventArgs)
{
updateScreenText(DumpScreen());
}
asked 4/22/2020 10:14:13 PM