您的位置:首页 > 编程语言 > C#

AutoCAD.Net/C#.Net QQ群:193522571 利用反射将父类中的属性传递到子类中,实测效率不高

2015-05-08 14:46 309 查看
foreach (PropertyInfo info in saddle.GetType().GetProperties())
{
try
{
string objString = info.Name;
object objValue = saddle.GetType().GetProperty(objString).GetValue(saddle, null);
this.GetType().GetProperty(objString).SetValue(this, objValue, null);
}
catch
{
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐