/// <summary> /// The <see cref="PresenterModule.TrialEventOccured"/> event handler. /// Stores the new trial event into the list. /// </summary> /// <param name="sender"> /// Source of the event. /// </param> /// <param name="e"> /// A <see cref="TrialEventOccuredEventArgs"/> with the event data. /// </param> private void ObjPresenterSlideChanged(object sender, SlideChangedEventArgs e) { if (e.NextSlide.IsDisabled) { return; } long time = this.counterChangedTime - this.recordingStarttime - this.currentTrialStarttime; // Store slide changed event var slideChangedEvent = new MediaEvent { EventID = this.trialEventList.Count, Param = e.SlideCounter + "#" + e.NextSlide.Name, Task = MediaEventTask.Show, Time = time, Type = EventType.Slide, SubjectName = this.currentTracker.Subject.SubjectName, TrialSequence = this.trialSequenceCounter }; if (this.trialSequenceCounter >= 0) { this.trialEventList.Add(slideChangedEvent); this.WriteTrialEventToRawData(slideChangedEvent); } // Store subjects response event var inputEvent = new InputEvent { EventID = this.trialEventList.Count }; if (e.Response != null) { inputEvent.Param = e.Response.ToString(); } inputEvent.SubjectName = this.currentTracker.Subject.SubjectName; inputEvent.Task = InputEventTask.SlideChange; inputEvent.Time = time; inputEvent.TrialSequence = this.trialSequenceCounter; inputEvent.Type = EventType.Response; if (this.trialSequenceCounter >= 0) { this.trialEventList.Add(inputEvent); this.WriteTrialEventToRawData(slideChangedEvent); } this.Invoke(this.delegateNewSlideAvailable); }
/// <summary> /// This method raises the <see cref="SlideChanged"/> /// event by invoking the delegates. /// It should be called when the current slide has changed. /// </summary> /// <param name="e"> /// A <see cref="SlideChangedEventArgs"/> with the event data. /// </param> /// . private void OnSlideChanged(SlideChangedEventArgs e) { if (this.SlideChanged != null) { AsyncHelper.FireAndForget(this.SlideChanged, this, e); } }