Example #1
0
 // Raise the event.
 protected virtual void OnEmotionChanged()
 {
     EmotionChanged.Raise(this, new EmotionChangedEventArgs()
     {
         Emotion = this.Emotion
     });
 }
Example #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
            });
        }