【发布时间】:2008-09-18 10:47:28
【问题描述】:
我怎样才能做到这一点?
switch(property.PropertyType){
case typeof(Boolean):
//doStuff
break;
case typeof(String):
//doOtherStuff
break;
default: break;
}
我不想使用该名称,因为字符串比较类型非常糟糕,并且可能会发生变化。
【问题讨论】:
标签: c# switch-statement