src/ZKEACMS.SectionWidget/ContentJsonConvert/SectionContentJsonConverter.cs

(完整代码) 1KB

/* http://www.zkea.net/ 
 * Copyright (c) ZKEASOFT. All rights reserved. 
 * http://www.zkea.net/licenses */

using System;
using ZKEACMS.SectionWidget.Models;
using Newtonsoft.Json.Linq;

namespace ZKEACMS.SectionWidget.ContentJsonConvert
{
    class SectionContentJsonConverter : JsonCreationConverter<SectionContent>
    {
        protected override SectionContent Create(Type objectType, JObject jObject)
        {
            var contentType = jObject["SectionContentType"].Value<int>();
            switch (contentType)
            {
                case (int)SectionContentBase.Types.CallToAction:
                    {
                        return new SectionContentCallToAction();
                    }
                case (int)SectionContentBase.Types.Image:
                    {
                        return new SectionContentImage();
                    }
                case (int)SectionContentBase.Types.Paragraph:
                    {
                        return new SectionContentParagraph();
                    }
                case (int)SectionContentBase.Types.Title:
                    {
                        return new SectionContentTitle();
                    }
                case (int)SectionContentBase.Types.Video:
                    {
                        return new SectionContentVideo();
                    }
                default: return new SectionContent();
            }
        }
    }
}

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

AI 解读 AI

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

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