Hi Einar,
It looks like you want to modify the visibility of the set accessor, so you can work with the property internally but restrict it externally?
Asymmetric Accessor Accessibility was added to C#2.0 , this lets you add the keyword 'internal' to either a get or set accessor to restrict it's visibility.
the only caveat is you must always have both the get and the set accessor to use this function, should be fine for your example.
public string MyProp
{
get { return this.myProp; }
internal set { this.myProp = value; }
}
- Craig
- Craig
"If you're not prepared to be wrong, you will never come up with anything original."
- Sir Ken Robinson