
Originally Posted by
wolfpackmars2
What would be the use for the DefaultValue property, aside from where a property grid may be used?
Not much really, except if you created a UserControl / custom control / component that you rely on heavily and want to add some user-friendliness to it. If 'where a property grid may be used' you mean dropping a PropertyGrid control on your form, then I'm not even sure if the DefaultValue attribute can be used, because the PropertyGrid does not show the context menu. I suppose you can add your own context menu, but then I'm not sure how to call the functionality that the Reset feature usually provides.
So basically it is just to make the design-time easier for your own custom controls.

Originally Posted by
kleinma
So really the only time you need full properties in VS2010 now is when you need logic in your getter/setter, or if you need read only/write only properties.
Can't you just use ReadOnly?
vb.net Code:
Public ReadOnly Property Value() As Integer
Shouldn't that just create a read-only automated property?
I think you do need to use full properties if you need different access modifiers on the getter and setter (or is that possible even with auto-implemented properties?).
If you can't, then I must say I like C#'s way much better:
csharp Code:
// read-only:
public int Value { get; }
// private set; public get:
public int Value { get; private set; }
That said, I'm not sure how it would be possible to implement this behavior for VB without breaking all formatting rules... Perhaps something like
vb.net Code:
Public Property Value() As Integer { Get, Private Set }
Public Property Value() As Integer With Get, Private Set
Public Property Value() As Integer With { Get, Private Set }
Public Property Value() As Integer
Get
Private Set
End Property
Meh?