Possible to print definition of Func<>
-
Hi fellows, a question from my side again! Would really need your expertise! Is therer a way (maybe with Reflection) to get the definition of a Function? Description: I have a self defined Function (yeah I know dynamic, but here it's really neccessary, would take too long to explain):
dynamic func = new Func((int i)=>{return 2*i;});
Chance to get to display the part {return 2*i;} programatically? (something like
MessageBox.Show("Function Code: {0}", functionCode);
(int i)=>{return 2*i;} would be fine as well, just if it makes any difference :-D Thank's in advance!
-
Hi fellows, a question from my side again! Would really need your expertise! Is therer a way (maybe with Reflection) to get the definition of a Function? Description: I have a self defined Function (yeah I know dynamic, but here it's really neccessary, would take too long to explain):
dynamic func = new Func((int i)=>{return 2*i;});
Chance to get to display the part {return 2*i;} programatically? (something like
MessageBox.Show("Function Code: {0}", functionCode);
(int i)=>{return 2*i;} would be fine as well, just if it makes any difference :-D Thank's in advance!
Have a read of this it should give you some starters http://stackoverflow.com/questions/4986563/how-to-read-a-method-body-with-reflection[^]
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch
-
Have a read of this it should give you some starters http://stackoverflow.com/questions/4986563/how-to-read-a-method-body-with-reflection[^]
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch