private void SaveRecordedData()
        {
            // To prevent overwrite an existing directory, we count the number of START_RECORD event
            this.countDirectories++;

            // Specify a name for your top-level folder.
            string filePath = System.IO.Path.Combine(mainPath, txtFilename.Text);

            // Prevent to overwrite directory container
            if (Directory.Exists(filePath))
            {
                filePath += this.countDirectories;
            }

            // Create a new directory
            System.IO.Directory.CreateDirectory(filePath);
            // Change directory
            System.IO.Directory.SetCurrentDirectory(filePath);

            // Create file patterns
            string colorPattern          = txtFilename.Text + "_color_";
            string depthPattern          = txtFilename.Text + "_depth_";
            string depthBodyIndexPattern = txtFilename.Text + "_body_";

            string skelPattern = txtFilename.Text + "_skel_";

            string colorWithDepthPattern = txtFilename.Text + "_coldep_";
            string depthWithColorPattern = txtFilename.Text + "_depcol_";

            string faceDataPattern = txtFilename.Text + "_face_";

            //Save collected data
            //depthSensor.SaveColorFrames(colorPattern); // In color space
            //depthSensor.SaveMapOfColorWithDepth(colorWithDepthPattern); // In color space
            depthSensor.SaveDepthFrames(depthPattern);                  // In depth space
            depthSensor.SaveMapOfDepthWithColor(depthWithColorPattern); // In depth space
            //depthSensor.SaveSkeletonFrames(skelPattern); // Complete skeleton in color and depth space
            depthSensor.SaveSkeletonUpFrames(skelPattern);              // Upper skeleton in color and depth space
            //depthSensor.SaveFaceData(faceDataPattern); // In both color and depth space
            //depthSensor.SaveBodyIndexFrames(depthBodyIndexPattern); // Since the depthInColor and colorInDepth are based in the body index frame, it is redundant
            // Return to the main path directory
            System.IO.Directory.SetCurrentDirectory(mainPath);
        }