/// <summary> /// Exports data /// </summary> /// <param name="folderPath"></param> /// <param name="data"></param> /// <param name="exportFileType"></param> public void ExportToFile(string folderPath, IEnumerable <NodeItem> data, ExportFileTypeEnum exportFileType = ExportFileTypeEnum.Csv) { switch (exportFileType) { case ExportFileTypeEnum.Csv: ExportToCsv(folderPath, data); break; case ExportFileTypeEnum.Json: ExportToJson(folderPath, data); break; } }
static ExportFormat ToExportFormat(ExportFileTypeEnum format) { switch (format.Alias) { case "core:exportFileTypeCsv": return(ExportFormat.Csv); case "core:exportFileTypeExcel": return(ExportFormat.Excel); case "core:exportFileTypeWord": return(ExportFormat.Word); default: throw new ArgumentException(); } }