jeudi 17 décembre 2015

Getting parameter values for calling method

Is there any way to do that in managed code or at the very least with no serious performance issues? Basically, what I'd like to get is of course something along the lines of

public void Method ( int Index, string Name, IPAddress IP, object Arg ) {
  object[] parameterValues = HereGoesMagic.GetParameterValues ( 
    new StackFrame ( 0, false ).GetMethod () 
  );
}

but, alas, I suspect that this is extremely wishful thinking on my part.





Aucun commentaire:

Enregistrer un commentaire