Yes but that is not a property. Just a public readonly variable.

On Fri, Jul 16, 2010 at 8:04 PM, Gordon Jones <[email protected]> wrote:
> Im not sure - but I think the following is nw supported
>
> Public Readonly Test() as string
>
> whit I think can also takea default value is this form
>
> Public Readonly Test() as string  = "VALUE"
>
> the value is set up in a variable wiht the same name as the property name
> prefixed wiht underscore:
> _Test which takes the same type as the property.  I seem to remember that
> you can not declear this variable otherwise it breaks the compile and you
> have to set up the property the long way.  but you can use it.
>
> As I say all this is from memory nubut I hope it is correct
>
> Martyn
>
>
>> Date: Fri, 16 Jul 2010 13:18:38 +1000
>> Subject: Re: VB10 auto readonly properties?
>> From: [email protected]
>> To: [email protected]
>>
>> Damn! Thanks Winston!
>>
>> On Fri, Jul 16, 2010 at 11:55 AM, Winston Pang <[email protected]>
>> wrote:
>> > Also, backing connect report:
>> >
>> >
>> > https://connect.microsoft.com/VisualStudio/feedback/details/457176/readonly-auto-implemented-properties
>> >
>> >
>> > On Fri, Jul 16, 2010 at 11:53 AM, Winston Pang <[email protected]>
>> > wrote:
>> >>
>> >> Don't think it's supported, has to be the long way, i.e.
>> >>
>> >>     ReadOnly Property Test As String
>> >>         Get
>> >>
>> >>         End Get
>> >>     End Property
>> >>
>> >> ReadOnly Property
>> >>
>> >> On Fri, Jul 16, 2010 at 11:40 AM, Bec Carter <[email protected]>
>> >> wrote:
>> >>>
>> >>> In C# I can do this
>> >>>
>> >>> public string MyProperty { get; private set; }
>> >>>
>> >>> What is the VB10 equivalent? Hopefully not the long way :(
>> >>
>> >
>> >
>
> ________________________________
> Get a free e-mail account with Hotmail. Sign-up now.

Reply via email to