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 1,613 other followers

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 Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

 
%d bloggers like this: