/////////////////////////////////////////////////////////////////////////// // /////////////////////////////////////////////////////////////////////////// private void OtherDirectoryRadio_Checked(object sender, RoutedEventArgs e) { options_ = ExportOutputPathOption.CustomPath; }
/////////////////////////////////////////////////////////////////////// //public string getFilePath() //{ // object tmp = LightFieldApplication.Experiment.GetValue(ExperimentSettings.FileNameGenerationFileFormatLocation); // if (tmp == null) // { // return "Null object"; // } // else // { // return tmp.ToString(); // } //} /////////////////////////////////////////////////////////////////////// private void Export_Tiff(string sourceFilename) { // Get the file manager IFileManager fm = LightFieldApplication.FileManager; // Block User Pop Ups LightFieldApplication.UserInteractionManager.SuppressUserInteraction = true; try { // Add Files List <string> itemsForExport = new List <string>(); itemsForExport.Add(sourceFilename); IList <IExportSelectionError> selectedErrors = new List <IExportSelectionError>(); ITiffExportSettings tifSettings = (ITiffExportSettings)fm.CreateExportSettings(ExportFileType.Tiff); // Specifics tifSettings.IncludeAllExperimentInformation = true; IExportSettings baseSettings_ = null; baseSettings_ = tifSettings; ExportOutputPathOption options_ = ExportOutputPathOption.InputPath; // Common Settings for all types // baseSettings_.CustomOutputPath = customPath_; baseSettings_.OutputPathOption = options_; baseSettings_.OutputMode = (ExportOutputMode)Enum.Parse(typeof(ExportOutputMode), "OneFilePerFrame"); selectedErrors = baseSettings_.Validate(itemsForExport); // Busy cursor during write using (new AddInStatusHelper(LightFieldApplication, ApplicationBusyStatus.Busy)) { fm.Export(baseSettings_, itemsForExport); } //// Async Mode //if (AsyncCheckBox.IsChecked == true) //{ // fm.ExportCompleted += new EventHandler<ExportCompletedEventArgs>(fm_ExportCompleted); // application_.UserInteractionManager.ApplicationBusyStatus = ApplicationBusyStatus.Busy; // fm.ExportAsync(baseSettings_, itemsForExport); // // Enable cancel // CancelButton.IsEnabled = true; // ExportButton.IsEnabled = false; //} //// Sync Mode //else //{ // ExportButton.IsEnabled = false; // // Busy cursor during write // using (new AddInStatusHelper(LightFieldApplication, ApplicationBusyStatus.Busy)) // { // fm.Export(baseSettings_, itemsForExport); // } // ExportButton.IsEnabled = true; //} } finally { LightFieldApplication.UserInteractionManager.SuppressUserInteraction = false; } }
/////////////////////////////////////////////////////////////////////////// // /////////////////////////////////////////////////////////////////////////// private void SourceLocationRadio_Checked(object sender, RoutedEventArgs e) { options_ = ExportOutputPathOption.InputPath; }