public override void Export(IFile fileSystem, string rootPath) { string folderPath = GetFolder(rootPath); fileSystem.CreateDirectoryWithoutReadOnly(folderPath); string fileFullPath = System.IO.Path.Combine(folderPath, GetExportedFilename()); fileSystem.WriteBinary(fileFullPath, content); }
public override void Export(IFile fileSystem, string rootPath) { string exportPath = GetFolder(rootPath); fileSystem.CreateDirectoryWithoutReadOnly(exportPath); for (int i = 0; i < elementList.Count; i++) { string imageFileName = i.ToString() + ".png"; fileSystem.WriteBinary(System.IO.Path.Combine(exportPath, imageFileName), elementList[i]); _data.exportedImageNameList.Add(imageFileName); } string indexJson = JsonConvert.SerializeObject(_data, Formatting.Indented); fileSystem.WriteText(System.IO.Path.Combine(exportPath, INDEX_FILENAME), indexJson); }
public override void Export(IFile fileSystem, string rootPath) { string folderPath = GetFolder(rootPath); fileSystem.CreateDirectoryWithoutReadOnly(folderPath); List<NamedElementFilename> filenameList = new List<NamedElementFilename>(); for (int i = 0; i < elementList.Count; i++) { string filename = System.IO.Path.Combine(folderPath, i.ToString()); fileSystem.WriteBinary(filename, elementList[i].content); filenameList.Add ( new NamedElementFilename { name = elementList[i].name, filename = filename } ); } string indexFullPath = System.IO.Path.Combine(folderPath, GetIndexFilename()); string indexJson = JsonConvert.SerializeObject(filenameList); fileSystem.WriteText(indexFullPath, indexJson); }