Click here to Skip to main content
15,903,385 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
SQL
I have an Structure in a Class where i have a property named 'Name'. and other properties values inside the structure depends of the set of this value, is there any way to make them publics only when this first property is Set ?.

When i create an instance of the class , and access to this structure all the properties are available.
Posted
Comments
Sergey Alexandrovich Kryukov 22-Mar-14 21:46pm    
Not clear at all.
—SA

1 solution

It sounds like what you want to do is best accomplished by class inheritance.

Create a base class with the common features (like the 'Name') property then create classes that inherit from this for each of your alternative sets of properties.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900