Delegate for an Action< ref T1, T2>
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm trying to create a delegate of a static method which takes a ref argument. Please don't ask why I'm doing such a cockamamie thing. It's all part of learning how .Net, C#, and reflection work and how to optimize it. My code is: public struct DataRow { private double t ; static public void Cram_T ( ref DataRow dr , double a_t ) { dr . t = a_t ; } } '''' Type myType = typeof ( DataRow ); MethodInfo my_Cram_T_Method = myType . GetMethod ( "Cram_T" ); var myCram_T_Delegate = Delegate . CreateDelegate ( typeof ( Action ), my_Cram_T