CitrixVirtualUserScript OccurredEvents Property C# API
Get the list of Citrix Events that have occurred.

Namespace: Facilita.Fc.Citrix
Assembly: fcCitrix (in fcCitrix.dll) Version: 9.5.5.77
Syntax

public IList<CitrixEvent> OccurredEvents { get; }
Remarks

When the underlying Citrix object raises an event it is appended to the OccurredEvents list. The WaitForEvent call with return when the required event appears on this list, and any matching event removed from the list. The list is cleared at the end of each iteration or when ClearEvents is called. Examining this list will show exactly what events are available to be matched. This is useful when WaitForEvent is failing to match on an expected event.
Examples

ClearEvents();
TypeText("{ENTER}", 10); // perform a UI action
Pause(5000);

// Display the list of new events 
foreach (CitrixEvent ev in this.OccurredEvents)
    WriteMessage("CitrixEvent", ev.ToString());

ClearEvents();

TypeText("{ENTER}", 10); // perform a UI action         

try
{
    WaitForEvent(new CitrixEvent(CitrixEventType.WindowCreate, @"Home Page - Windows Internet Explorer"));
}
catch (Facilita.Exception.TimeoutException)
{
    Warn("Timeout waiting for event");
    // Display the list of new events 
    foreach (CitrixEvent ev in this.OccurredEvents)
        WriteMessage("CitrixEvent", ev.ToString());
}
See Also