I have a code problem, that I could solve by using the old C macro #defines. Nevertheless these kind of #defines are not supported in C#. Is there some way to solve my problem with another trick?
In multiple classes and multiple methods I have this code:
MyLanguageClass.Instance.GetText("download_id",
this.GetType(),
System.Reflection.MethodBase.GetCurrentMethod());
(MyLanguageClass is code written by me.) So I am using the class type and current method as part of an id to get a string. (And the strings are defined and filled in another part of the program, but these are, for this issue, not important details.) But the GetType and GetCurrentMethod are always the same, hence I would like them to be replaced by a #define macro like in C. On the other hand I cannot put something in a function, like with other situations where you would perhaps use a C-macro defined 'fake' function, since I want to use the current class and current method of the position in the code there, where I call GetText. In principle all the user of my function should type is something like:
MyLanguageClass.Instance.GetText("download_id", "use classtype and current method as part of the id");
The programmer that uses the function does not have to be bothered with the reflection details used, et cetera. Any ideas?