コード例 #1
0
ファイル: TemplateManager.cs プロジェクト: siteserver/SS.Poll
        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);
        }