C
C#5mo ago
eric bonito

Hi is it possible to allow parametersArray to contain an instance variable?

I am trying to access a method in a way that is dynamic. The method has byRef variables. Is this feasible?
methodInfo.Invoke(currentObject, parametersArray)
methodInfo.Invoke(currentObject, parametersArray)
2 Replies
eric bonito
eric bonito5mo ago
Here is the ugly fix I am doing for now:

else if (expectedType.IsByRef)
{
if (expectedType.GetElementType() == typeof(string))
{tempString = ____
....

else if (expectedType.IsByRef)
{
if (expectedType.GetElementType() == typeof(string))
{tempString = ____
....
Basically Im using a bunch of elseif statements for a string vs int vs double