Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How can one class set a property to be seen by another c
Message
 
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01566989
Message ID:
01567057
Views:
24
>>I now have another question. Say, I have
>>
>>Application 
>>{
>>
>>  Database Database {get;set}
>>
>>   public Application(Database database)
>>   {
>>       Database = database;
>>   }
>>}
>>
>>
>>How can I from the database class set properties of the Application class (its parent in VFP terminology)?
>
>You can't. The Application class is NOT it's parent - it's just holding a reference to it. Countless other classes might also hold a reference to the same object.

Any other way around this problem? E.g. in the application class I want to keep a reference to Database class, but from Database class I want to set properties of the application class?

If, say, I add similar (or same) properties to the database class, can I somehow signal to the application class when database is setting its properties, so I can update application class properties?
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform