public class ExceptionUndefinedEnumConditions : Exception
{
public ExceptionUndefinedEnumConditions(Type type)
{
if (type != null)
{
base.Message = type.ToString();
}
else
{
this.Message = "Type Undefined";
} }
}我要自定义一个错误,然后传一个Type进来,但我上面的定法不行
应该如何写?
谢谢
解决方案 »
- 关闭串口时报错
- dockpanel2.6在net4.0的winform是不是用不了?
- 无法打开D:\visual studio 2005\SDK\v2.0\bin\sdkvars.bat进行写操作?
- 怎么做流程图,用什么工具做,有示例提供一下
- 百分提问,DLL引用失败
- 请问哪位做过点击按钮直接打开QQ对话窗口的功能?
- 怎么向数据库插入图片和读取数据库内的图片数据?
- ASP.net(VC#)连接Access数据库的问题
- 欢迎有MRP经验的朋友 谢谢
- 关于赋值与数值传送的问题
- 怎么结束线程
- You can only have one <head runat="server"> control on a page
: base(type != null ? type.ToString() : "Type Undefined")
{ }
public class ExceptionUndefinedEnumConditions : Exception
{
public new string Message
{
get;
set;
} public ExceptionUndefinedEnumConditions(Type type)
{
if (type != null)
{
this.Message = type.ToString();
}
else
{
this.Message = "Type Undefined";
}
}
}