Example #1
0
        /// <summary>
        /// Update the parameters of the action relying on an event that occured
        /// </summary>
        /// <param name="e">the event that occured</param>
        public void UpdateAction(QlikMoveEventArgs e)
        {
            //get the result
            ActionPartResult result = this.parts[this.currentActionPart].checkPart(e);

            if (result == ActionPartResult.SUCCESS)
            {
                if (this.currentActionPart + 1 < this.parts.Length)
                {
                    //search for the next part
                    this.currentActionPart++;
                    //add the event to the list of triggering events
                    this.triggeredEvents.Add(e);
                }
                else
                {
                    //fire event or use method to send action
                    if (this.ActionRecognised != null)
                    {
                        this.triggeredEvents.Add(e);
                        this.ActionRecognised(this, new ActionArgs(this.name, e.timeStamp, this.triggeredEvents));
                    }
                    //reset
                    this.reset();
                }

            }
            else if (result == ActionPartResult.FAIL)
            {
                //reset (or pause)
                this.reset();
            }
        }
Example #2
0
 /// <summary>
 /// launched when an event is fired from GestureHelper or VoiceHelper
 /// </summary>
 /// <param name="sender">the gesture/voice manager</param>
 /// <param name="e">the event detected</param>
 private void Event_EventRecognised(object sender, QlikMoveEventArgs e)
 {
     //send e to Action Recogniser queue
     ActionMgr.AddEvent(e);
 }