private static async Task<int> WriteFileAsync(Project project, string file) { string extension = Path.GetExtension(file); string template = await TemplateMap.GetTemplateFilePathAsync(project, file); if (!string.IsNullOrEmpty(template)) { int index = template.IndexOf('$'); if (index > -1) { template = template.Remove(index, 1); } await WriteToDiskAsync(file, template); return index; } await WriteToDiskAsync(file, string.Empty); return 0; }
private static async Task <int> WriteFileAsync(Project project, string file, FileNameDialogResult input) { var extension = Path.GetExtension(file); var template = await TemplateMap.GetTemplateFilePathAsync(project, file, input); if (!string.IsNullOrEmpty(template)) { var index = template.IndexOf('$'); if (index > -1) { template = template.Remove(index, 1); } await WriteToDiskAsync(file, template); return(index); } await WriteToDiskAsync(file, string.Empty); return(0); }