alexguirre / RAGENativeUI

MIT License
115 stars 38 forks source link

Possible AmbiguousMatchException when building template with MenuItemAttribute #37

Closed alexguirre closed 4 years ago

alexguirre commented 5 years ago

If the Invoke method of the PropertyType is overloaded, the following code will throw an AmbiguousMatchException.

MethodInfo invokeMethod = prop.PropertyType.GetMethod("Invoke");

We should use the GetMethod overloads to only get the methods with either of the following signatures

void Invoke();
void Invoke(MenuItem item);

Additionally, if both are present, which one should we take? Should we execute both?

See #35.