VTemplate.Engine/Utility.cs

(开头部分) 1KB

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

/* ***********************************************
 * Author		:  kingthy
 * Email		:  kingthy@gmail.com
 * Description	:  Utility
 *
 * ***********************************************/
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Xml;
using System.Web;
using System.Text.RegularExpressions;
using System.ComponentModel;
using System.Collections;
using System.Drawing;
using System.Reflection;
using System.Collections.Specialized;
using System.Data;
using System.Data.Common;

namespace VTemplate.Engine
{
    /// <summary>
    /// 实用类
    /// </summary>
    internal static class Utility
    {
        /// <summary>
        /// 
        /// </summary>
        static Utility()
        {
            RenderInstanceCache = new Dictionary<string, object>(StringComparer.InvariantCultureIgnoreCase);
            DbFactoriesCache = new Dictionary<string, DbProviderFactory>(StringComparer.InvariantCultureIgnoreCase);
            TypeCache = new Dictionary<string, Type>(StringComparer.InvariantCultureIgnoreCase);
        }

        #region 数据判断函数块
        /// <summary>
        /// 判断是否是空数据(null或DBNull)
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        internal static bool IsNothing(object value)
        {
            return value == null || value == DBNull.Value;
        }
        /// <summary>
        /// 判断是否是整数
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        internal static bool IsInteger(string value)
        {
            if (string.IsNullOrEmpty(value)) return false;
            if (value[0] != '-' && !char.IsDigit(value[0])) return false;

            int i;
            return int.TryParse(value, out i);

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

AI 解读

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

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