In VB.Net, I have an object named WorkflowButtonEventArgs
that inherits from System.EventArgs
.
The WorkflowButtonEventArgs
class contains two ByRef
Properties. These are objects that are in memory, and I do not want them duplicated or copied in any way.
Can I pass the WorkflowButtonEventArgs
object ByVal
in VB.Net and have it still preserve the two ByRef
definitions in WorkflowButtonEventArgs
?
Specifically, if I pass it ByVal:
Dim e As New WorkflowButtonEventArgs(...) ' e has some ByRef properties
RaiseEvent SomeEventName(e) ' e is passed ByVal
Will the ByRef
Properties/Members in e
(WorkflowButtonEventArgs
class) not be copied or duplicated in memory?
Long-story-short: Can I pass e
ByVal
, or do I need to pass it ByRef
since it contains ByRef
Properties?