S
Sunny
Hi,
I want to have a property, for which I want only the get part to be public,
but set to be private? is it possible, or I have to make only get public,
and make a private method to set the value of the underlying variable? I
need to capture setting the variable in order to fire event, but I do not
want to allow users of the class to set the property?
May I doble declare the property like:
public int MyProp {get { return myVar;}}
private int MyProp {set {myVar = value;}}
Thanks
Sunny
I want to have a property, for which I want only the get part to be public,
but set to be private? is it possible, or I have to make only get public,
and make a private method to set the value of the underlying variable? I
need to capture setting the variable in order to fire event, but I do not
want to allow users of the class to set the property?
May I doble declare the property like:
public int MyProp {get { return myVar;}}
private int MyProp {set {myVar = value;}}
Thanks
Sunny