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
From
27/02/2013 12:41:24
 
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:
01567056
Views:
29
This message has been marked as a message which has helped to the initial question of the thread.
>>>>>E.g. I have middlewarebase class that has protected virtual property. I have middlewareMain class that has Invoke method and the two methods to set and return invokestring. I also have Sales class with the exact same methods of setting and getting that string.
>>>>>
>>>>>I set the invokestring in the MiddlewareMain and I need to read it in Sales class.
>>>>
>>>>Of course - if you set an instance property of classX, don't expect that this will change an instance property of classY
>>>
>>>But this is what I need. I need to set the string in one class and read it in the other class.
>>
>>Then I misunderstood what you want to do and Bonnie is right - a static property is the only way.
>
>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform