src/EasyFrameWork/ViewPort/Descriptor/TextBoxDescriptor.cs

(开头部分) 5KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

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

using Easy.ViewPort.Validator;
using System;

namespace Easy.ViewPort.Descriptor
{
    public class TextBoxDescriptor : BaseDescriptor<TextBoxDescriptor>
    {
        public TextBoxDescriptor(Type modelType, string property)
            : base(modelType, property)
        {
            this.TagType = HTMLEnumerate.HTMLTagTypes.Input;
        }

        public string DateFormat { get; set; }
        public string JavaScriptDateFormat { get; set; }



        public TextBoxDescriptor FormatAsDate()
        {
            FormatDate("yyyy/MM/dd");
            FormatDateForJavaScript("YYYY/MM/DD");
            this.AddClass("Date");
            return this;
        }

        public TextBoxDescriptor FormatAsDateTime()
        {
            FormatDate("yyyy/MM/dd HH:mm");
            FormatDateForJavaScript("YYYY/MM/DD HH:mm:ss");
            return this;
        }
        public TextBoxDescriptor FormatDate(string format)
        {
            this.DateFormat = format;
            this.AddProperty("DateFormat", format);
            this.AddProperty("ValueType", "Date");
            this.AddClass("Date");
            return this;
        }
        public TextBoxDescriptor FormatDateForJavaScript(string format)
        {
            this.JavaScriptDateFormat = format;
            this.AddProperty("JsDateFormat", format);
            this.AddProperty("ValueType", "Date");
            this.AddClass("Date");
            return this;
        }
        public TextBoxDescriptor MaxLength(int max)
        {
            this.Validator.Add(new StringLengthValidator(0, max)
            {
                Property = this.Name
            });
            return this;
        }
后面还有 140 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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