【发布时间】:2019-09-09 10:04:35
【问题描述】:
This is the official page of the method 我想我需要使用“out”参数作为参数。我有这样的方法:
bool GetInfo(out List<foo> bar);
如何在不更改调用方法的情况下使用 out 参数?在这种情况下,我真的不想返回 Set of bool 和 List。
到目前为止,我尝试过这样使用它:
EndInvoke("GetInfo", new object[] { out bar }, ...);
EndInvoke("GetInfo", new object[] { bar }, ...);
EndInvoke("GetInfo", new object[] { }, ...);
EndInvoke("GetInfo", null, ...);
List<foo> bar = (List<foo>)EndInvoke("GetInfo", new object[] { bar }, ...);
但没有什么真正有意义,对象数组中的输出栏显然根本不起作用。
【问题讨论】: