公告
财富商城
积分规则
提问
发文
2019-01-09 08:21发布
老娘就宠你
public object MethodName(ref float y) { //method }
How do I defined a Func delegate for this method?
In .NET 4+ you can also support ref types this way...
ref
public delegate bool MyFuncExtension<in string, MyRefType, out Boolean>(string input, ref MyRefType refType);
It cannot be done by Func but you can define a custom delegate for it:
Func
delegate
public delegate object MethodNameDelegate(ref float y);
Usage example:
public object MethodWithRefFloat(ref float y) { return null; } public void MethodCallThroughDelegate() { MethodNameDelegate myDelegate = MethodWithRefFloat; float y = 0; myDelegate(ref y); }
最多设置5个标签!
In .NET 4+ you can also support
ref
types this way...It cannot be done by
Func
but you can define a customdelegate
for it:Usage example: