// what happens a button is entered private void SequenceUpdatedEvent(object sender, RoutedEventArgs event_args) { EnlightKinectTileButton button = sender as EnlightKinectTileButton; // sender cast check if (button == null) { return; } // hack for events firing when gesture just complete if (sequence_index >= sequence.Length) { return; } // reference check or equals() check? both *should* be OK if (sequence[sequence_index] != button) { return; } // reset timer resetTimer.Stop(); resetTimer.Start(); // move the index up sequence_index++; // fire event to window to display the next in sequence // if complete, send null + true if (sequence_index == sequence.Length) { this.SequenceUpdated(this, new SequenceEventArgs(null, true)); } else { this.SequenceUpdated(this, new SequenceEventArgs(sequence[sequence_index], false)); } }
public SequenceEventArgs(EnlightKinectTileButton button, bool complete) { this.NextButton = button; this.SequenceComplete = complete; }