A
A Ratcliffe
Is it possible to create a set property which has a different accessibility
than the get property?
For example, I have a private field in a base class. The Get property should
be public so that anyone can see the value of the field. However the Set
property should be protected and non-overridable (since it does various
additional calculations/actions based on the new value) and only derived
classes should be able to Set a new value.
Hope that makes sense,
Thanks in advance for any help,
Ann-Marie Ratcliffe
than the get property?
For example, I have a private field in a base class. The Get property should
be public so that anyone can see the value of the field. However the Set
property should be protected and non-overridable (since it does various
additional calculations/actions based on the new value) and only derived
classes should be able to Set a new value.
Hope that makes sense,
Thanks in advance for any help,
Ann-Marie Ratcliffe