mercredi 24 juin 2020

Ambiguous Entry System.Reflection

Im getting a error when im parsing a method trough system.reflection:

System.Reflection.AmbiguousMatchException

typeof(Graphics).GetMethod("DrawRectangle").Invoke(g, new object[] {
     Pens.Red, new Rectangle(200, 200, 100, 50)
});

however it works nice when im parsing it trough the compiler

g.DrawRectangle(Pens.Red, new Rectangle(200,200,100,50));

is there a way to specify which method i want to call?





Aucun commentaire:

Enregistrer un commentaire