Sunday, 18 August 2013

C#: How to add a class member named "protected"

C#: How to add a class member named "protected"

I'm fairly new to C# but have extensive experience in Objective-C and OOP.
I'm using Json.NET to automatically parse API responses to objects. It so
happens that one of the objects returned has a property named protected.
Obviously this is a problem, because protected is a keyword for class
member declaration.
"protected": true
Is it possible to add a member with the name protected at all?
Is it possible to add setters and getters that get triggered, if the
parser tries to set the protected property? (but assign the value to a
private member named _protected)
Should I modify the parser to behave different when he encounters a
property named protected?
Thanks for any advice.

No comments:

Post a Comment