DynamicObject - a call method based on the value of the argument

I would like to be able to store a dictionary of actions and be able to call those that are based on the dictionary key. If the key is not found, no action will be called. I had the idea of ​​making a call using an object that extends DynamicObject and receives a dictionary of actions at build time, but then all examples of using DynamicObject are based on properties, not methods. I would like to do something like this:

`dynamicDictionary.InvokeMethod(commandName);`
+3
source share
1 answer

openource Dynamitey . , MS ExpandoObject, Dynamitey, DynamicObjects.BaseDictionary, - .

, . , Dynamic.InvokeAction(dynamicDictionary, commandName). DLR , ​​ .

+4

All Articles