/// <summary> /// Returns true if a template type is for a language file, else true /// </summary> /// <param name="templateType">Template Type</param> /// <returns>true if the template type is for a language file, else false</returns> public bool IsTemplateTypeLanguage(TemplateType templateType) { DefaultTemplateEntry templateEntry = _DefaultTemplates.FirstOrDefault(d => d.TemplateType == templateType); if (templateEntry == null) { return(false); } return(templateEntry.IsLanguage); }
/// <summary> /// Returns the default export template by its type /// </summary> /// <param name="projectId">Project Id</param> /// <param name="templateType">Template Type</param> /// <returns>Export Template, NULL if no saved template exists</returns> public async Task <ExportTemplate> GetDefaultTemplateByType(string projectId, TemplateType templateType) { ExportTemplate template = await _templateDbAccess.GetDefaultTemplateByType(projectId, templateType); if (template == null) { DefaultTemplateEntry defaultTemplate = _DefaultTemplates.First(t => t.TemplateType == templateType); template = await CreateDefaultTemplate(defaultTemplate.Category, defaultTemplate.TemplateType, true); } return(template); }