本文整理汇总了C#中IFile.WriteText方法的典型用法代码示例。如果您正苦于以下问题:C# IFile.WriteText方法的具体用法?C# IFile.WriteText怎么用?C# IFile.WriteText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IFile
的用法示例。
在下文中一共展示了IFile.WriteText方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Export
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);
}
}
示例2: Export
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);
}
示例3: Export
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);
}
示例4: Export
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);
}
示例5: Export
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);
}