Click here to Skip to main content
15,911,896 members
Home / Discussions / C#
   

C#

 
AnswerRe: Design Form inside Form Pin
Luc Pattyn18-Jul-08 14:34
sitebuilderLuc Pattyn18-Jul-08 14:34 
GeneralRe: Design Form inside Form Pin
nelsonpaixao18-Jul-08 15:15
nelsonpaixao18-Jul-08 15:15 
QuestionHow does one get the name of a variable which is passed to a method? Pin
jeffb4218-Jul-08 12:42
jeffb4218-Jul-08 12:42 
GeneralRe: How does one get the name of a variable which is passed to a method? Pin
Mbah Dhaim18-Jul-08 13:03
Mbah Dhaim18-Jul-08 13:03 
GeneralRe: How does one get the name of a variable which is passed to a method? Pin
jeffb4218-Jul-08 13:19
jeffb4218-Jul-08 13:19 
AnswerRe: How does one get the name of a variable which is passed to a method? Pin
Luc Pattyn18-Jul-08 13:11
sitebuilderLuc Pattyn18-Jul-08 13:11 
GeneralRe: How does one get the name of a variable which is passed to a method? Pin
jeffb4218-Jul-08 13:24
jeffb4218-Jul-08 13:24 
AnswerRe: How does one get the name of a variable which is passed to a method? Pin
Guffa18-Jul-08 13:24
Guffa18-Jul-08 13:24 
No, it's not possible. An instance of an object doesn't have a name, neither has the reference to it.

The variable holding the reference does have a name, but that is not passed along to the method, neither is a reference to the variable. Also, unless the assembly is started with debug information, I don't think that you can even get the name of a local variable.

There might not even be a variable holding the reference. Consider these examples:

Here you have no variable at all:
DumpObject(new MyObject());


Here the variable is just a member of a KeyValuePair structure in a dictionary:
Dictionary<int,MyObject> MyDictionary = new Dictionary<int,MyObject>();
MyDictionary.Add(42, new MyObject());
DumpObject(MyDictionary[42]);

What would you imagine that the name should be; "Value", "42" or "MyDictionary"?

Despite everything, the person most likely to be fooling you next is yourself.

GeneralRe: How does one get the name of a variable which is passed to a method? Pin
Luc Pattyn18-Jul-08 13:33
sitebuilderLuc Pattyn18-Jul-08 13:33 
JokeRe: How does one get the name of a variable which is passed to a method? Pin
PIEBALDconsult18-Jul-08 13:52
mvePIEBALDconsult18-Jul-08 13:52 
GeneralRe: How does one get the name of a variable which is passed to a method? Pin
Luc Pattyn18-Jul-08 14:06
sitebuilderLuc Pattyn18-Jul-08 14:06 
GeneralRe: How does one get the name of a variable which is passed to a method? Pin
jeffb4218-Jul-08 14:11
jeffb4218-Jul-08 14:11 
GeneralRe: How does one get the name of a variable which is passed to a method? Pin
Luc Pattyn18-Jul-08 14:17
sitebuilderLuc Pattyn18-Jul-08 14:17 
QuestionRe: How does one get the name of a variable which is passed to a method? Pin
nelsonpaixao18-Jul-08 15:17
nelsonpaixao18-Jul-08 15:17 
Questionhopefully simple problem with type casting Pin
auberondreaming18-Jul-08 12:02
auberondreaming18-Jul-08 12:02 
AnswerRe: hopefully simple problem with type casting Pin
Luc Pattyn18-Jul-08 12:09
sitebuilderLuc Pattyn18-Jul-08 12:09 
GeneralRe: hopefully simple problem with type casting Pin
auberondreaming18-Jul-08 12:19
auberondreaming18-Jul-08 12:19 
GeneralRe: hopefully simple problem with type casting Pin
Luc Pattyn18-Jul-08 12:47
sitebuilderLuc Pattyn18-Jul-08 12:47 
AnswerRe: hopefully simple problem with type casting Pin
Mbah Dhaim18-Jul-08 12:11
Mbah Dhaim18-Jul-08 12:11 
GeneralRe: hopefully simple problem with type casting Pin
auberondreaming18-Jul-08 12:15
auberondreaming18-Jul-08 12:15 
QuestionCreating remote process & StdOut Pin
Harkamal Singh18-Jul-08 8:27
Harkamal Singh18-Jul-08 8:27 
AnswerRe: Creating remote process & StdOut Pin
Luc Pattyn18-Jul-08 8:48
sitebuilderLuc Pattyn18-Jul-08 8:48 
GeneralRe: Creating remote process & StdOut Pin
Harkamal Singh18-Jul-08 21:43
Harkamal Singh18-Jul-08 21:43 
QuestionWeird error Pin
damianrda18-Jul-08 7:37
damianrda18-Jul-08 7:37 
AnswerRe: Weird error Pin
Judah Gabriel Himango18-Jul-08 7:50
sponsorJudah Gabriel Himango18-Jul-08 7:50 

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.