public static List <TemplateInfo> GetTemplateInfoList(string type) { var templateInfoList = new List <TemplateInfo>(); var directoryPath = GetTemplatesDirectoryPath(); var directoryNames = PollUtils.GetDirectoryNames(directoryPath); foreach (var directoryName in directoryNames) { var templateInfo = GetTemplateInfo(directoryPath, directoryName); if (templateInfo == null) { continue; } if (string.IsNullOrEmpty(type) && string.IsNullOrEmpty(templateInfo.Type) || PollUtils.EqualsIgnoreCase(type, templateInfo.Type)) { templateInfoList.Add(templateInfo); } } return(templateInfoList); }