mercredi 20 décembre 2017

Compile a method at runtime and get its parameters in C#

I've got a string such as:

string s = "public bool function([System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] ref string param1, [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] string param2, [System.Xml.Serialization.XmlElementAttribute(\"param3\", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] paramType[] param3) {";

Im only interested in the parameters names, datatypes and if they are passed as "ref" or "out". Is there a way to compile the string as a method and get the methods parameters?





Aucun commentaire:

Enregistrer un commentaire