public override void Destroy() { replay.SkeletonFrameReady -= SkeletonFrameReady; replay.Stop(); if (this.fileStream != null) { this.fileStream.Close(); } }
private void replayButton_Click(object sender, RoutedEventArgs e) { OpenFileDialog openFileDialog = new OpenFileDialog { Title = "Select filename", Filter = "Replay files|*.replay" }; if (openFileDialog.ShowDialog() == true) { if (replay != null) { replay.SkeletonFrameReady -= replay_SkeletonFrameReady; replay.Stop(); } Stream recordStream = File.OpenRead(openFileDialog.FileName); replay = new SkeletonReplay(recordStream); replay.SkeletonFrameReady += replay_SkeletonFrameReady; replay.Start(); } }