SystemExtend/TypeExt.cs

(开头部分) 1KB

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

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;


namespace SystemExtend
{
    public static  class TypeExt
    {
        /// <summary>
        /// 是否数值类型
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        public static bool IsDigitType(this Type type)
        {
            return (type.Equals(typeof(System.Byte))
               || type.Equals(typeof(System.SByte))
               || type.Equals(typeof(System.Char))
               || type.Equals(typeof(System.Decimal))
               || type.Equals(typeof(System.Double))
               || type.Equals(typeof(System.Single))
               || type.Equals(typeof(System.Int32))
               || type.Equals(typeof(System.UInt32))
               || type.Equals(typeof(System.Int64))
               || type.Equals(typeof(System.UInt64))
               || type.Equals(typeof(System.Int16))
               || type.Equals(typeof(System.UInt16))
               );
        }
        
        /// <summary>
        /// 是否字符串类型
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        public static bool IsStringType(this Type type)
        {
            return  type.Equals(typeof(System.String))  ;
        }

        /// <summary>
        /// 是否时间类型
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        public static bool IsDateTimeType(this Type type)
        {
            return  type.Equals(typeof(System.DateTime)) ;
        }



        /// <summary>
        /// 是否存在指定的字段名
        /// </summary>
        /// <param name="idr"></param>
        /// <param name="fieldName"></param>

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

AI 解读

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

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