ReadOnly significance?

  • Thread starter Thread starter Jon Davis
  • Start date Start date
J

Jon Davis

What is the difference between a Property block that has a ReadOnly keyword
and a Get block, versus a Property block that has only a Get block?

Thanks,
Jon
 
Jon Davis said:
What is the difference between a Property block that has a ReadOnly
keyword
and a Get block, versus a Property block that has only a Get block?

The compiler won't "eat" a property with a 'Get' block only but without the
'ReadOnly' attribute.
 
A Property that just has a Get block and does not indicate that it is
ReadOnly is illegal. If there is only a Get block, then you MUST indicate
ReadOnly.

There is no choice between the 2.
 
Thanks. I presumed otherwise only because C# has a readonly keyword
somewhere, and I never use it in my get-only properties.

Jon
 

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

Back
Top