public void ExportAll() { if (string.IsNullOrWhiteSpace(outputPath)) { throw new ArgumentException("outputPath is null"); } if (CurrentData == null) { NextFile(); } if (!ExportUtility.ValidateExportSettings(exportSettings, CurrentData)) { throw new InvalidOperationException("Current export settings are invalid for at least one of the selected formats"); } ApplyModificationChain(); if (batchMode) { string fullPath = Path.Combine(outputPath, Path.GetFileName(InputFileList[CurrentFileIndex])); ExportFile(CurrentData, fullPath); while (HasNextFile) { NextFile(); fullPath = Path.Combine(outputPath, Path.GetFileName(InputFileList[CurrentFileIndex])); if (CurrentData != null) { ApplyModificationChain(); ExportFile(CurrentData, fullPath); } } } else { ExportFile(CurrentData, outputPath); } if (ExportCompleted != null) { ExportCompleted(); } }
public static bool WriteFilePointData(ExportJob job) { try { if (job.format.IsFormat("ASC") || job.format.IsFormat("PTS_XYZ")) { IExporter exporter; exporter = new PointDataExporter(job.data); ExportUtility.WriteFile(exporter, job.FilePath, job.format); return(true); } else { WriteError("Don't know how to export " + job.format.ToString()); return(false); } } catch (Exception e) { WriteError("Failed to create Point data file!"); WriteLine(e.ToString()); return(false); } }
//Format specific settings /*public int mcaOffsetX = 0; * public int mcaOffsetZ = 0; * public bool useSplatmaps;*/ public void SetOutputFormats(string[] inputs, bool append) { if (!append) { outputFormats.Clear(); } foreach (string input in inputs) { if (string.IsNullOrWhiteSpace(input)) { continue; } var ff = ExportUtility.GetFormatFromInput(input); if (ff != null) { outputFormats.Add(ff); } else { ConsoleOutput.WriteWarning("Unknown or unsupported format: " + input); } } }