public override void Export(IFile fileSystem, string rootPath) { string exportPath = GetFolder(rootPath); fileSystem.CreateDirectoryWithoutReadOnly(exportPath); string stringList = string.Join(Environment.NewLine, _data.stringList.Select(e=>e.content).ToArray()); fileSystem.WriteText(System.IO.Path.Combine(exportPath, INDEX_FILENAME), stringList); }
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); string exportFilePath = System.IO.Path.Combine(exportPath, INDEX_FILENAME); string fontJson = JsonConvert.SerializeObject(_data, Formatting.Indented); fileSystem.WriteText(exportFilePath, fontJson); }
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 exportPath = GetFolder(rootPath); fileSystem.CreateDirectoryWithoutReadOnly(exportPath); string exportFilePath = System.IO.Path.Combine(exportPath, INDEX_FILE_NAME); string fontJson = JsonConvert.SerializeObject(_data, Formatting.Indented); fileSystem.WriteText(exportFilePath, fontJson); for (int i = 0; i < _fontElementList.Count; i++) { string exportElementPath = System.IO.Path.Combine(exportPath, i.ToString()); string fontElementJson = JsonConvert.SerializeObject(_fontElementList[i], Formatting.Indented); fileSystem.WriteText(exportElementPath, fontElementJson); } }
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); }