首页 > 其他 > 详细

C#反射调用其它DLL的委托事件 传值

时间:2014-09-16 09:12:50      阅读:442      评论:0      收藏:0      [点我收藏+]
bubuko.com,布布扣
 void Test2_Click(object sender, RoutedEventArgs e)
        {
            var item = (MenuItem)sender;
            string path = @Environment.CurrentDirectory + "\\";
            Plugin plugin = ApplicationSharedData.Plugins[item.Header.ToString()];

            ApplicationSharedData.ModulEventCommunication(this, "TestEvent", "DeleBindData", path, plugin, new object[] { "参数1", "参数2","" });
            //注 在反射TestEvent 时候 ,TestEvent有几个参数 那么S_TestEvent 也有几个参数。
            //不然会抛出异常信息,TargetParameterCountException 参数的个数不同
        }


        private static void DeleBindData(string msg, string info,string tb)
        {
            _textbox.Text = tb;
        }
bubuko.com,布布扣

C#反射调用其它DLL的委托事件 传值

原文:http://www.cnblogs.com/dlbird/p/3974132.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!