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 10:09:30
 
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:
01567049
Views:
23
>>>>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.

>>
>>And that's what I thought you meant from the beginning! It'll need to be to be static ...
>>
>
>Yes, static works (I tested it yesterday), but I do not like that solution for many reasons.

There is nothing inherently wrong with statics, if they are used correctly. This may be the only way to accomplish what you're trying to do (unless I'm totally misunderstanding your intent).



>
>So, we're going to go with the class idea and re-factor a lot of code now. I wanted to pass that new class creation to my colleague, but he wants me to write it...
>
>So, I am back to the dilemma of naming this new class. I'll take a short break and try to pester him again.
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Reply
Map
View

Click here to load this message in the networking platform