是否BaseType - IsBaseType

2017-02-26 15:56:14  访问(1491) 赞(0) 踩(0)


        /// <summary>
        /// 是否BaseType - IsBaseType
        /// </summary>
        /// <param name="oValue"></param>
        /// <param name="baseTypeFullName"></param>
        /// <returns></returns>
        public static bool IsBaseType(object oValue, string baseTypeFullName)
        {
            if (oValue == null)
                return false;

            Type t = oValue.GetType();

            while (true)
            {
                if (t.FullName == baseTypeFullName)
                    return true;

                t = t.BaseType;

                if (t == null)
                    return false;
            }
        }


标签:是否BaseType - IsBaseType 

上一条:

下一条:


 

相关评论

评论加载中……
 

发表评论

类型:
内容:
  (Alt+Enter)
 
  ┈全部┈  
 
(显示默认分类)