Okay, this should be an easy object oriented C# question, but for some reason I have been unable to find the answer yet.
I am creating an object of my own called JAddress. And basically I want to be able to do the following:
JAddress.ZipCode.Text
JAddress.ZipCode.MyId
I am unsure on how to create the second level of properties! Doing only a first level is really easy.....public string ZipCodeDoes anyone know how to do this?
{
get { return m_ZipCode; }
set { m_ZipCode = value; }
}
Thanks in advance,
csdietrich
![]() |
0 |
![]() |
You would have its own ZipCode type (class) which is exposed in JAddress via ZipCode property (which probably is read-only, depending how you expose ZipCode via JAddress). This ZipCode type would have those Text and MyId properties
Thanks,
Teemu Keiski
Finland, EU
![]() |
0 |
![]() |
I'm quite the novice at doing some of this object oriented stuff. Could someone provide me with a quick example of how to do what was explained? I've been trying it for a while, but I'm getting all mixed up in the private, public, protected syntax.
Thanks!
![]() |
0 |
![]() |