public void SaveTextFile(IModelFilePath modelFile, string text) { if (modelFile.GetFilePath().FileType != FileType.Text) { throw new Exception("FileType is not text"); } InitializeFolders(modelFile); string path = $"{AssetsPath}{modelFile.GetFullPath()}"; File.WriteAllText(path, text); }
public string ReadTextFile(IModelFilePath modelFile) { if (modelFile.GetFilePath().FileType != FileType.Text) { throw new Exception("FileType is not text"); } string path = $"{AssetsPath}{modelFile.GetFullPath()}"; if (!File.Exists(path)) { return(""); } return(File.ReadAllText(path)); }