multiple accesibility

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a base class with a property HasChanged and instance variable _HasChange
I need HasChanged to be Public for Get and Protected for Set (so that only inheriting classes can change it
I know i could make the instance variable Protected but I dont really like that and I dont want two different properies either

any ideas?
 
* "=?Utf-8?B?Y2hpZWYgc2hlZXA=?= said:
I have a base class with a property HasChanged and instance variable _HasChanged
I need HasChanged to be Public for Get and Protected for Set (so that only inheriting classes can change it)
I know i could make the instance variable Protected but I dont really like that and I dont want two different properies either!

You will have to create a public readonly getter and a protected
'Set...' method. Different levels of accessibility for properties come
in VB 2005.
 
chief sheep said:
I have a base class with a property HasChanged and instance variable
_HasChanged I need HasChanged to be Public for Get and Protected for
Set (so that only inheriting classes can change it) I know i could
make the instance variable Protected but I dont really like that and
I dont want two different properies either!

Not possible. You must use two methods. (public readonly get haschanges,
protected sub SetHaschanges)


--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html
 
Back
Top