Groups | Blog | Home
all groups > c# > march 2007 >

c# : Setting the default member of a class


nano2k
3/6/2007 11:37:51 PM
Hi
I'm searching for the way to set up the default property of my class.
I'm using v1.1 of the fmk.
For example, when I drag an object of an ArrayList type into the Watch
window, it immediately displays the value of Count property like this:

myArrayList {Count=1} System.Collections.ArrayList

It's frustrating that I didn't find out how to specify this custom
attribute to my class.

Thanks.
Marc Gravell
3/7/2007 12:00:00 AM
nano2k
3/7/2007 2:53:42 AM
Thanks for reply.
It won't work.
I found out I need to modify 2 files in order to make the IDE to
understand what I want:

C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Packages
\Debugger\mcee_cs.dat
C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Packages
\Debugger\mcee_mc.dat

No other way?


Marc Gravell a scris:
[quoted text, click to view]
Fabio
3/7/2007 6:05:10 PM
"nano2k" <adrian.rotaru@ikonsoft.ro> ha scritto nel messaggio

[quoted text, click to view]

The IDE display the result of the ToString() method.
Override the ToString() and let it return the info you want to see in the
debugger.

Mattias Sjögren
3/7/2007 9:22:55 PM
[quoted text, click to view]

If you're using VS2005 and .NET Framework 2.0 you can use the
DebuggerDisplayAttribute instead.


Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
nano2k
3/8/2007 4:12:23 AM
Sorry, doesn't work


Fabio a scris:
[quoted text, click to view]
Fabio
3/8/2007 6:03:33 PM
"nano2k" <adrian.rotaru@ikonsoft.ro> ha scritto nel messaggio

[quoted text, click to view]

It *works*.
If it doesn't work I don't understand the problem or you didn't it
correctly.


AddThis Social Bookmark Button