public virtual void EventOccured(UserEvent userEvent)
        {
            try
            {
                bool useEvent = true;
                foreach (EventFilter filter in filters)
                {
                    useEvent &= filter.UseEvent(userEvent, userAction.LastEvent);
                    if (!useEvent) return;
                }
                userAction.Register(userEvent);

                EventWriter eventWriter = recordingOptions.EventWriter;
                userAction.CurrentUserEvent.WriteTo(eventWriter, recordingOptions);
                if (userAction.RepeatEvent)
                {
                    WhiteLogger.Instance.Debug("Updating last event with: " + userAction);
                    userEventListener.UpdateEvent(eventWriter.Code);
                }
                else
                {
                    WhiteLogger.Instance.Debug("Creating new event: " + userAction);
                    userEventListener.NewEvent(eventWriter.Code);
                }
            }
            catch (Exception e)
            {
                WhiteLogger.Instance.Info("Error during event callback", e);
            }
        }
Esempio n. 2
0
 public virtual void Register(UserEvent userEvent)
 {
     repeatEvent = userEvent.IsRepeatEvent(lastEvent);
     if (repeatEvent)
         allEvents.Remove(lastEvent);
     allEvents.Add(userEvent);
     lastEvent = userEvent;
 }
Esempio n. 3
0
 public override bool IsRepeatEvent(UserEvent otherEvent)
 {
     return otherEvent is TextBoxEvent && otherEvent.IsIdenfiedAs(uiItem.PrimaryIdentification);
 }
 public virtual bool UseEvent(UserEvent userEvent, UserEvent lastUserEvent)
 {
     if (lastUserEvent == null || userEvent is TextBoxEvent || userEvent is TreeNodeClickedEvent) return true;
     TimeSpan span = userEvent.Timestamp - lastUserEvent.Timestamp;
     return span > TimeDifferenceBetweenTwoUserEvents;
 }
Esempio n. 5
0
 public virtual bool IsRepeatEvent(UserEvent otherEvent)
 {
     return false;
 }
Esempio n. 6
0
 public override bool IsRepeatEvent(UserEvent otherEvent)
 {
     return(otherEvent is TextBoxEvent && otherEvent.IsIdenfiedAs(uiItem.PrimaryIdentification));
 }
Esempio n. 7
0
 public virtual bool IsRepeatEvent(UserEvent otherEvent)
 {
     return(false);
 }