Click here to Skip to main content
15,912,400 members
Home / Discussions / C#
   

C#

 
GeneralRe: Performance Cost for Design time features on Custom Control Pin
Pete O'Hanlon14-Jan-08 11:21
mvePete O'Hanlon14-Jan-08 11:21 
QuestionC# to PDA ??? Pin
NewToAspDotNet14-Jan-08 10:49
NewToAspDotNet14-Jan-08 10:49 
AnswerRe: C# to PDA ??? Pin
martin_hughes14-Jan-08 11:53
martin_hughes14-Jan-08 11:53 
GeneralCode decompilation VC++ and VB.NET Pin
xkrja14-Jan-08 8:57
xkrja14-Jan-08 8:57 
GeneralRe: Code decompilation VC++ and VB.NET Pin
Dave Kreskowiak14-Jan-08 9:15
mveDave Kreskowiak14-Jan-08 9:15 
GeneralRe: Code decompilation VC++ and VB.NET Pin
Dan Neely14-Jan-08 9:30
Dan Neely14-Jan-08 9:30 
GeneralXML reading [modified] Pin
RascaPR14-Jan-08 7:09
RascaPR14-Jan-08 7:09 
GeneralRe: XML reading Pin
Not Active14-Jan-08 7:21
mentorNot Active14-Jan-08 7:21 
GeneralRe: XML reading Pin
RascaPR14-Jan-08 7:24
RascaPR14-Jan-08 7:24 
GeneralRe: XML reading Pin
Not Active14-Jan-08 8:38
mentorNot Active14-Jan-08 8:38 
QuestionBest way to detect installed mail clients Pin
Spacedmc14-Jan-08 6:11
Spacedmc14-Jan-08 6:11 
GeneralReflection: Getting property name from property itself Pin
GazzaJ14-Jan-08 5:12
GazzaJ14-Jan-08 5:12 
GeneralRe: Reflection: Getting property name from property itself Pin
PIEBALDconsult14-Jan-08 5:24
mvePIEBALDconsult14-Jan-08 5:24 
GeneralRe: Reflection: Getting property name from property itself Pin
GazzaJ14-Jan-08 5:27
GazzaJ14-Jan-08 5:27 
GeneralRe: Reflection: Getting property name from property itself Pin
Ennis Ray Lynch, Jr.14-Jan-08 5:43
Ennis Ray Lynch, Jr.14-Jan-08 5:43 
GeneralRe: Reflection: Getting property name from property itself Pin
GazzaJ14-Jan-08 5:52
GazzaJ14-Jan-08 5:52 
GeneralRe: Reflection: Getting property name from property itself Pin
PIEBALDconsult14-Jan-08 8:33
mvePIEBALDconsult14-Jan-08 8:33 
GeneralRe: Reflection: Getting property name from property itself Pin
Judah Gabriel Himango14-Jan-08 5:54
sponsorJudah Gabriel Himango14-Jan-08 5:54 
GeneralRe: Reflection: Getting property name from property itself Pin
GazzaJ14-Jan-08 5:57
GazzaJ14-Jan-08 5:57 
GeneralRe: Reflection: Getting property name from property itself Pin
Judah Gabriel Himango14-Jan-08 6:04
sponsorJudah Gabriel Himango14-Jan-08 6:04 
Stuck in 2.0 land, eh?

The one possible way to do this without a string is from within the property or method itself:

string nameOfTheProperty;
...

public string MyProperty
{
   get
   {
       nameOfTheProperty = MethodInfo.GetCurrentMethod().Name;
   }
}
This has the obvious downside of having to invoke the property in order to get its name.

Another possibility that works only with methods (it doesn't work with properties) is by using delegates:

MethodInvoker dummyDelegate = MyFunction;
string nameOfTheMethod = dummyDelegate.Method.Name;

...

void MyFunction()
{
}






Tech, life, family, faith: Give me a visit.
I'm currently blogging about: What this world needs... (Video)
The apostle Paul, modernly speaking: Epistles of Paul

Judah Himango


GeneralRe: Reflection: Getting property name from property itself Pin
DavidNohejl14-Jan-08 6:23
DavidNohejl14-Jan-08 6:23 
GeneralRe: Reflection: Getting property name from property itself Pin
S. Senthil Kumar14-Jan-08 6:18
S. Senthil Kumar14-Jan-08 6:18 
GeneralRe: Reflection: Getting property name from property itself [modified] Pin
PIEBALDconsult14-Jan-08 8:55
mvePIEBALDconsult14-Jan-08 8:55 
GeneralRe: Reflection: Getting property name from property itself Pin
GazzaJ14-Jan-08 23:39
GazzaJ14-Jan-08 23:39 
GeneralRe: Reflection: Getting property name from property itself Pin
DaveyM6914-Jan-08 23:56
professionalDaveyM6914-Jan-08 23:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.