Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
 public virtual void Register(UserEvent userEvent)
 {
     repeatEvent = userEvent.IsRepeatEvent(lastEvent);
     if (repeatEvent)
         allEvents.Remove(lastEvent);
     allEvents.Add(userEvent);
     lastEvent = userEvent;
 }
Ejemplo 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;
 }
Ejemplo n.º 5
0
 public virtual bool IsRepeatEvent(UserEvent otherEvent)
 {
     return false;
 }
Ejemplo n.º 6
0
 public override bool IsRepeatEvent(UserEvent otherEvent)
 {
     return(otherEvent is TextBoxEvent && otherEvent.IsIdenfiedAs(uiItem.PrimaryIdentification));
 }
Ejemplo n.º 7
0
 public virtual bool IsRepeatEvent(UserEvent otherEvent)
 {
     return(false);
 }