public async Task Generate(IProjectFolder folder) { await Task.Factory.StartNew(async () => { var name = _settings.ClassName; var sourceTemplate = new CPlusPlusClassTemplate(name, _settings.GenerateHeader); var headerTemplate = new CPlusPlusClassHeaderTemplate(name); if (_settings.GenerateHeader) { await SourceFile.Create(folder, $"{(name.Contains('.') ? name : name + ".h")}", headerTemplate.TransformText()); } if (_settings.GenerateClass) { await SourceFile.Create(folder, $"{name}.cpp", sourceTemplate.TransformText()); } }); }
public async Task Generate(IProjectFolder folder) { await Task.Factory.StartNew(async() => { var name = _settings.ClassName; var sourceTemplate = new CPlusPlusClassTemplate(name, _settings.GenerateHeader); var headerTemplate = new CPlusPlusClassHeaderTemplate(name); if (_settings.GenerateHeader) { await SourceFile.Create(folder, $"{(name.Contains('.') ? name : name + ".h")}", headerTemplate.TransformText()); } if (_settings.GenerateClass) { await SourceFile.Create(folder, $"{name}.cpp", sourceTemplate.TransformText()); } }); }