undefpropertyexception.cs
来自「该项目中对 SQLHelper 类进行了简单封装」· CS 代码 · 共 58 行
CS
58 行
/*
* UndefPropertyException.cs @Microsoft Visual Studio 2005 <.NET Framework 2.0>
* AfritXia
* 2007-10-13
*
* Copyright(c) http://www.AfritXia.NET/
*
*/
using System;
using System.Reflection;
namespace NET.AfritXia.DBUtility
{
/// <summary>
/// 未定义的属性异常
/// </summary>
public class UndefPropertyException : Exception
{
// 属性名称
private string m_propName = null;
// 所属类
private Type m_classType = null;
/// <summary>
/// 类参数构造器
/// </summary>
/// <param name="propInfo">属性信息</param>
/// <param name="masterObjType">所属对象类型</param>
internal UndefPropertyException(string propName, Type classType)
{
this.m_propName = propName;
this.m_classType = classType;
}
/// <summary>
/// 获取异常信息
/// </summary>
public override string Message
{
get
{
if (this.m_propName == null || this.m_classType == null)
return "";
// 获取属性名称
string propName = this.m_propName;
// 获取所属类名称
string className = this.m_classType.Namespace + "." + this.m_classType.Name;
// 设置异常信息
string message = "在 {0} 类中未定义 {1} 属性 ( Undefine property {1} in class {0} )";
// 返回异常信息
return String.Format(message, className, propName);
}
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?