Duplicated items in watch window ?

G

Guest

Lets say I have following event handler
private void PrintDocument_PrintPage(Object sender, PrintPageEventArgs e)
{
/// some code
}

If I open a watch window on "sender" or on "e", some of the items in watch
window get duplicated, like;
"defaultPageSettings" and "DefaultPageSettings"
or
"DocumentName" and "documentName" , etc;
except the first letter's case they have everything common.
What is the reason to provide the same data 2 times? There must be some...


Please guide.
 
D

Daniel O'Connell [C# MVP]

Sachin said:
Lets say I have following event handler
private void PrintDocument_PrintPage(Object sender, PrintPageEventArgs e)
{
/// some code
}

If I open a watch window on "sender" or on "e", some of the items in watch
window get duplicated, like;
"defaultPageSettings" and "DefaultPageSettings"
or
"DocumentName" and "documentName" , etc;
except the first letter's case they have everything common.
What is the reason to provide the same data 2 times? There must be some...

This is mainly an issue with the debugger. It shows both the property and
private field that backs it up. In this case defaultPageSettings is the
field that the property DefaultPageSettings returns.

This feature is invaluable in many circumstances, but it does cause
confusino occasionally as well.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top