The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 4,262 other subscribers

reflection – C# – Resolving a parameter name at runtime – Stack Overflow

Posted by jpluimers on 2012/03/27

So I won’t forget: a GetName method returning the name of a parameter, local or field.

Tags: C#, reflection, IL parsing, argument name, anonymous type, generic type cachegeneric type caching.

–jeroen

via: reflection – C# – Resolving a parameter name at runtime – Stack Overflow.

4 Responses to “reflection – C# – Resolving a parameter name at runtime – Stack Overflow”

  1. […] the use of GetDiskFreeSpaceEx that generates CSV output for the passed parameters. It uses the anonymous type cache, and below is the code I promised a while […]

  2. […] anonymous types to a method, if that method has a generic parameter type. I regularly use this to Resolving a parameter name at runtime using the Generic Type Cache technique described by Rinat […]

  3. […] public const fields. Not flexible enough. There are a few tricks used. The first trick is how to obtain the name of a method parameter without using a string literal (you now probably get it that I don’t like literals). Thanks to Rinat Abdullin, he provided […]

  4. […] first trick is how to obtain the name of a method parameter without using a string literal (you now probably get it that I don’t like literals). Thanks to Rinat Abdullin, he provided […]

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.