void OnTrainingEvent(Object sender, TrainingEventArgs e) { switch (e.Type) { case TrainingEventType.Start: break; case TrainingEventType.End: sw.Close(); StopRecord(); if (processFeature) { trainingManager.Status = "Start processing"; ExecuteOfflineProcessor(); trainingManager.Status = "Done processing"; TrainModel(); trainingManager.Status = "Done training"; } break; case TrainingEventType.StartGesture: sw.WriteLine("{0} {1} {2}", TrainingEventType.StartGesture.ToString(), e.Gesture, depthFrameNumber); break; } }