SmartSQL/SmartSQL.DocUtils/DocFactory.cs

(完整代码) 1KB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SmartSQL.DocUtils.DBDoc;
using SmartSQL.DocUtils.Dtos;

namespace SmartSQL.DocUtils
{
    public class DocFactory
    {
        public static Doc CreateInstance(DocType type, DBDto dto)
        {
            switch (type)
            {
                case DocType.chm:
                    return new ChmDoc(dto);
                case DocType.html:
                    return new HtmlDoc(dto);
                case DocType.word:
                    return new WordDoc(dto);
                case DocType.excel:
                    return new ExcelDoc(dto);
                case DocType.pdf:
                    return new PdfDoc(dto);
                case DocType.md:
                    return new MarkDownDoc(dto);
                case DocType.xml:
                    return new XmlDoc(dto);
                case DocType.json:
                    return new JsonDoc(dto);
                default:
                    return new ChmDoc(dto);
            }
        }
    }
}

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读 AI

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。