-1

given global is of type dynamic:

public void addGuiMethodHandler(string methodName, Handler handler)
{
    using (global)
    {
        global.methodName = handler;
    }
}

But in the runtime "methodName" is referenced instead of it's value (from method arg).

Any advice would be greatly appreciated!

Vistritium
  • 380
  • 2
  • 12
  • You probably need to add more code - and to me it's totally unclear what problem you are experiencing. – Andreas Mar 20 '14 at 22:09

1 Answers1

1

If you're looking to set a property on a class based upon a string, you'll need to use reflection. See Set object property using reflection

The type of global doesn't matter (except in whether the attempt will be successful).

Community
  • 1
  • 1
KevinS
  • 242
  • 1
  • 7