Exposing properties in a nexted class?

B

Bruce

I have a nested class and I would like to expose the properties of the
nested class. How do I do this?



In the following class, I can see all of the properties of
FitnessUserProfile in VB. I can see the Activity class within the
FitnessUserProfile object but I can't see any
FitnessUserProfile.Activity properties. Why?

I am using Visual Studio 2005.




namespace GarXface
{


public ref class FitnessUserProfile : public ICloneable
{

public:

property unsigned BirthDay
{
void set(unsigned day)
{
m_pProfile->SetBirthDay(day);
}

unsigned get()
{
return m_pProfile->GetBirthDay();
}
}


ref class Activity : public ICloneable {
internal:

Activity(void);

public:

property float MaxHeartRate
{
void set(float heartRate)
{

}

float get()
{

}

}
 
P

Pavel Minaev

I have a nested class and I would like to expose the properties of the
nested class.  How do I do this?

In the following class, I can see all of the properties of
FitnessUserProfile in VB.  I can see the Activity class within the
FitnessUserProfile object but I can't see any
FitnessUserProfile.Activity properties.   Why?

Because you don't have a property named FitnessUserProfile.Activity of
the corresponding type - or, at least, I do not see it in your code
sample. Nested classes are nested _classes_, and not necessarily
nested _objects_.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top