Пример #1
0
        /// <summary>
        /// Cancels the running export task and hides the progress bar.
        /// </summary>
        internal void cancelCurrentExport(object sender, EventArgs a)
        {
            OpenNIRecordingController exportVideo = videoDisplay.Source as OpenNIRecordingController;

            if (exportVideo == null)
            {
                return;
            }

            exportVideo.CancelExport();
            exportVideo.ResetExportEventHandlers();
            exportForm.Hide();
        }
Пример #2
0
        /// <summary>
        /// Reports success and tries to generate data index file.
        /// </summary>
        private void exportFinished(
            OpenNIRecordingController sender,
            DirectoryInfo exportDir, List <int> frames, List <int> userIDs,
            ImageDictionary exportedFiles2D,
            ImageDictionary exportedFiles3D, bool ExportRelativePathNames,
            String export_filename_suffix)
        {
            // Report success.
            lazyInvoke((MethodInvoker) delegate
            {
                exportForm.textBoxProgress.Text =
                    "Exporting images finished. Generating data index file...";
            });


            try
            {
                if (exportedFiles2D != null)
                {
                    using (FileStream write_to = File.OpenWrite(
                               Path.Combine(exportDir.FullName, "Export2D" + export_filename_suffix + ".xml")))
                    {
                        movementDataSerializer.Serialize(write_to, exportedFiles2D);
                    }
                }
                if (exportedFiles3D != null)
                {
                    using (FileStream write_to = File.OpenWrite(
                               Path.Combine(exportDir.FullName, "Export3D" + export_filename_suffix + ".xml")))
                    {
                        movementDataSerializer.Serialize(write_to, exportedFiles3D);
                    }
                }
            }
            catch (Exception e)
            {
                showException("Error creating data index file: \n" +
                              e.Message);
            }

            // Report success.
            lazyInvoke((MethodInvoker) delegate
            {
                exportForm.Hide();
                textBoxExport.Text = "Last export successful to folder " + exportDir.FullName;
            });

            sender.ResetExportEventHandlers();
        }
        /// <summary>
        /// Reports success and tries to generate data index file.
        /// </summary>
        private void exportFinished(
            OpenNIRecordingController sender,
            DirectoryInfo exportDir, List<int> frames, List<int> userIDs,
            ImageDictionary exportedFiles2D,
            ImageDictionary exportedFiles3D, bool ExportRelativePathNames,
            String export_filename_suffix)
        {
            // Report success.
            lazyInvoke((MethodInvoker)delegate
            {
                exportForm.textBoxProgress.Text =
                    "Exporting images finished. Generating data index file...";
            });

            try
            {
                if (exportedFiles2D != null)
                {
                    using (FileStream write_to = File.OpenWrite(
                        Path.Combine(exportDir.FullName, "Export2D" + export_filename_suffix + ".xml")))
                    {
                        movementDataSerializer.Serialize(write_to, exportedFiles2D);
                    }
                }
                if (exportedFiles3D != null)
                {
                    using (FileStream write_to = File.OpenWrite(
                        Path.Combine(exportDir.FullName, "Export3D" + export_filename_suffix + ".xml")))
                    {
                        movementDataSerializer.Serialize(write_to, exportedFiles3D);
                    }
                }
            }
            catch (Exception e)
            {
                showException("Error creating data index file: \n" +
                    e.Message);
            }

            // Report success.
            lazyInvoke((MethodInvoker)delegate
            {
                exportForm.Hide();
                textBoxExport.Text = "Last export successful to folder " + exportDir.FullName;
            });

            sender.ResetExportEventHandlers();
        }