在 VB.Net 中,我有一个名为的对象WorkflowButtonEventArgs,它继承自System.EventArgs.
该类WorkflowButtonEventArgs包含两个ByRef属性。这些是内存中的对象,我不希望它们以任何方式复制或复制。
我可以在 VB.Net 中传递WorkflowButtonEventArgs对象ByVal并让它仍然保留其中的两个ByRef定义WorkflowButtonEventArgs吗?
具体来说,如果我通过 ByVal:
Dim e As New WorkflowButtonEventArgs(...) ' e has some ByRef properties
RaiseEvent SomeEventName(e) ' e is passed ByVal
(类)中的ByRef属性/成员不会在内存中复制或复制吗?eWorkflowButtonEventArgs
长话短说:我可以通过e ByVal,还是我需要通过它,ByRef因为它包含ByRef属性?