First off, you don't have a property called "_name". You have a class
member or field called "_name" which you are exposing with a property called
"Name".
No property can have more than one getter and/or setter. If you want to
expose the raw value separately then you have to create another property
with a different name, such as RawName. There are no limitations about
where a property getter derives the values it returns, so multiple
properties can access the same class member if needed.
The syntax you describe, myObject.Name.Raw, would require that Name expose a
class or structure with a property of its own called Raw. And then your
doctored property would have to be exposed in the same way, e.g.,
myObject.Name.Doctored, since Name would only return a reference to the
class instance that implements Name.
--Bob
"Jimbo" <jc****@gmail.com> wrote in message
news:11**********************@c13g2000cwb.googlegr oups.com...
I am sort of new to C#. Currently have a private property called
"_name" in a class. I have written a public getter and setter routine
for it called "Name".
Currently, the getter for the property does some data manipulation
before it returns the value. I wanted to add another getter to this
property that would returnt the "Raw" value (what is stored in _name).
Example:
myObject.Name.Raw --returns the raw data
Any ideas would be very helpful. Thanks in advance.