Part 53 Reflection in C#

Part 54 Reflection Example

here is the code

private void btnDiscover_Click(object sender, EventArgs e)
{
lbMethods.Items.Clear();
lbProperties.Items.Clear();
lbConstructor.Items.Clear();
string typeName = txtTypeName.Text.Trim();
Type t = Type.GetType(typeName);
if (t == null)
{
MessageBox.Show("Type Is No Exit, Please Enter A Right Type!", "Warnning", MessageBoxButtons.OK);
txtTypeName.Clear();
txtTypeName.Focus();
}
else
{
MethodInfo[] methods = t.GetMethods();
PropertyInfo[] properties = t.GetProperties();
ConstructorInfo[] constructors = t.GetConstructors();
foreach (var method in methods)
{
lbMethods.Items.Add(string.Concat(method.ReturnType.Name," ", method.Name));
}
foreach (var property in properties)
{
  lbProperties.Items.Add(string.Concat(property.PropertyType.Name, " ", property.Name));
}
foreach (var constructor in constructors)
{
  lbConstructor.Items.Add(constructor.ToString());
}
}
}

Part 55 Late binding using reflection

最新文章

  1. win7自动登录桌面
  2. paper 23 :Kullback–Leibler divergence KL散度(2)
  3. JDE910笔记1--基础介绍及配置[转]
  4. Codeforces Round #130 (Div. 2)
  5. 无法完成安装:'unsupported configuration: hda-duplex not supported in this QEMU binary'
  6. 关于mysql 连接数
  7. Haproxy均衡负载部署和配置文件详解
  8. ECMAScript 5中新增的数组方法
  9. java开发中的链式思维 —— 设计一个链式过滤器
  10. .NET链接Oracle 参数绑定问题
  11. php5.3命名空间内使用 php内置类的时候
  12. Android必知必会-Handler可能引起的内存泄露
  13. Redis(1)---五种数据结构
  14. 转://Linux大内存页Oracle数据库优化
  15. Mac mumu模拟器设置代理
  16. 超恶心的TP模版取值
  17. Digital biquad filter
  18. System.ArgumentException: 目标数组的长度不够。请检查 destIndex 和长度以及数组的下限
  19. js数据结构之列表的详细实现方法
  20. 如何启动、关闭和设置ubuntu防火墙

热门文章

  1. ArcSDE 10.2建立SDE服务
  2. tomcat如何简单调优
  3. 如何自学Java
  4. Win7环境下VS2010配置Cocos2d-x-2.1.4最新版本号的开发环境
  5. grunt入门之grunt watch的使用
  6. hadoop分布式部署(2014-3-8)
  7. OS_TASK.C
  8. iOS开发——开发必备OC篇&UITableView设置界面完整封装(二)
  9. 商户怎样选择商业wifi进行移动营销
  10. Gtest源码剖析:1.实现一个超级简单的测试框架xtest