dlbird的博客
我思我想故我在

导航

 

2014年9月16日

摘要: namespaceConsoleApplication{classProgram{publicstaticvoids_TestEvent(stringmsg){Console.WriteLine(msg);}staticvoidMain(string[]args){Assemblyass=Assem... 阅读全文
posted @ 2014-09-16 15:29 雪域月光 阅读(193) 评论(0) 推荐(0) 编辑
 
摘要: 如何:使用反射将委托挂钩.NET Framework 4.5其他版本当使用反射来加载和运行程序集时,不能使用 C#+=运算符或 Visual BasicAddHandler 语句等语言功能将事件挂钩。以下过程显示如何通过用反射获取所需的全部类型将现有方法挂钩到事件,以及如何使用反射发出来创建动态方法... 阅读全文
posted @ 2014-09-16 11:50 雪域月光 阅读(225) 评论(0) 推荐(0) 编辑
 
摘要: 利用反射绑定事件处理程序(C#)传统的写法:强类型的情况下using System;using System.Collections.Generic;using System.Text;using System.Reflection;namespace ConsoleApplication3{ ... 阅读全文
posted @ 2014-09-16 11:45 雪域月光 阅读(363) 评论(0) 推荐(0) 编辑
 
摘要: 插件模块与模块之间的通信在这里做个代码备注 防止下次忘记。。。using System;using System.Collections.Generic;using System.IO;using System.Linq;using System.Reflection;using System.Wi... 阅读全文
posted @ 2014-09-16 10:05 雪域月光 阅读(814) 评论(0) 推荐(0) 编辑
 
摘要: C#反射调用其它DLL的委托事件 传值在插件式开发。我们要调用其它插件或模块的委托事件时、那么我们需要通过反射。复制代码namespace Module2{ /// /// MainWindow.xaml 的交互逻辑 /// [Plugin("MainWindow", "... 阅读全文
posted @ 2014-09-16 08:23 雪域月光 阅读(2413) 评论(0) 推荐(0) 编辑