Exemplo n.º 1
0
 // Raise the event.
 protected virtual void OnEmotionChanged()
 {
     EmotionChanged.Raise(this, new EmotionChangedEventArgs()
     {
         Emotion = this.Emotion
     });
 }
Exemplo n.º 2
0
        // Raise an event when the emotion of the Emotiv changes.
        protected virtual void OnEmotionChanged(object sender, EmotionChangedEventArgs e)
        {
            var source = sender as EmotivDevice;

            if (sender == null)
            {
                Debug.Assert(false);
                return;
            }
            // This is only necessary if want to do some preprocessing on the data (some business logic).
            ProcessEmotiveData(source);

            // Raise the actual event (notify anyone who is listening).
            EmotionChanged.Raise(source, new EmotionChangedEventArgs()
            {
                Emotion = _emotiv.Emotion
            });
        }
Exemplo n.º 3
0
 protected virtual void OnEmotionChanged(Emotion old, Emotion @new)
 {
     EmotionChanged?.Invoke(this, new FacialExpressionEventArgs(old, @new));
 }
 /// <inheritdoc />
 public void OnEvent(EmotionChanged arg)
 {
     //TODO: If over time, notify bot
 }