Click here to Skip to main content
16,005,162 members
Home / Discussions / C#
   

C#

 
GeneralCheckbox Controls in a form Pin
Billy Whizz11-Apr-05 21:02
Billy Whizz11-Apr-05 21:02 
GeneralRe: Checkbox Controls in a form Pin
Dave Kreskowiak12-Apr-05 7:02
mveDave Kreskowiak12-Apr-05 7:02 
GeneralConvert string to a string array Pin
myNameIsRon11-Apr-05 19:29
myNameIsRon11-Apr-05 19:29 
GeneralRe: Convert string to a string array Pin
Robert Rohde11-Apr-05 19:41
Robert Rohde11-Apr-05 19:41 
GeneralRe: Convert string to a string array Pin
myNameIsRon11-Apr-05 19:56
myNameIsRon11-Apr-05 19:56 
GeneralRe: Convert string to a string array Pin
techieboi12-Apr-05 5:33
techieboi12-Apr-05 5:33 
GeneralI need advice on class design Pin
tantiboh11-Apr-05 19:12
tantiboh11-Apr-05 19:12 
GeneralRe: I need advice on class design Pin
Christian Graus11-Apr-05 19:26
protectorChristian Graus11-Apr-05 19:26 
tantiboh wrote:
First, how do I instantiate Room or Player classes dynamically; that is, how can I dynamically define the names of those classes as they are instantiated?

You can't define the name of the variable that way, but why would you ? Store a name in the class instance, take it in the constructor.

tantiboh wrote:
Second, since a class can only access the public methods and properties of classes instantiated within it, how in the world do I handle the communication between my classes, both queries from Room to System and queries from Room to User?

In the absence of multiple inheritance, you can use interfaces here. Define an interface that describes the information you need to get in common from all three class types ( such as name ), and one for any stuff you need from each class seperately. You may want to also write Fascade classes, for example a RoomFascade class would be used to provide methods that help you work with a Room, but would bloat the Room class if they were all put in there.



Christian

I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
GeneralRe: I need advice on class design Pin
tantiboh11-Apr-05 19:45
tantiboh11-Apr-05 19:45 
GeneralRe: I need advice on class design Pin
Skynyrd12-Apr-05 1:18
Skynyrd12-Apr-05 1:18 
GeneralRe: I need advice on class design Pin
tantiboh12-Apr-05 6:55
tantiboh12-Apr-05 6:55 
Generaldifference between GetType() method , is operator and typeof operator Pin
RuchirD11-Apr-05 17:52
RuchirD11-Apr-05 17:52 
GeneralRe: difference between GetType() method , is operator and typeof operator Pin
S. Senthil Kumar11-Apr-05 18:41
S. Senthil Kumar11-Apr-05 18:41 
Generaldata access problem Pin
brian5511-Apr-05 17:47
brian5511-Apr-05 17:47 
GeneralRe: data access problem Pin
mhmoud rawas11-Apr-05 23:15
mhmoud rawas11-Apr-05 23:15 
GeneralCrystalDecisions.CrystalReports.Engine.LoadSaveReportException: Load crpe32.dll failed. Pin
shail4111-Apr-05 17:02
shail4111-Apr-05 17:02 
GeneralRe: CrystalDecisions.CrystalReports.Engine.LoadSaveReportException: Load crpe32.dll failed. Pin
CyberDevil6712-Apr-05 5:04
CyberDevil6712-Apr-05 5:04 
GeneralRe: CrystalDecisions.CrystalReports.Engine.LoadSaveReportException: Load crpe32.dll failed. Pin
shail4112-Apr-05 16:49
shail4112-Apr-05 16:49 
GeneralInvoking Control Events in Code Pin
Thoughthopper11-Apr-05 15:35
Thoughthopper11-Apr-05 15:35 
GeneralChanging the decimal symbol... Pin
Tugbay Sahin11-Apr-05 13:50
Tugbay Sahin11-Apr-05 13:50 
GeneralRe: Changing the decimal symbol... Pin
Christian Graus11-Apr-05 14:51
protectorChristian Graus11-Apr-05 14:51 
Generalimage in a contextmenu Pin
Robske11-Apr-05 12:01
Robske11-Apr-05 12:01 
GeneralRe: image in a contextmenu Pin
ChesterPoindexter11-Apr-05 12:29
professionalChesterPoindexter11-Apr-05 12:29 
GeneralInstaller launch condition question Pin
Asad Hussain11-Apr-05 9:05
Asad Hussain11-Apr-05 9:05 
GeneralArraylist cast Pin
Member 87436711-Apr-05 8:03
Member 87436711-Apr-05 8:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.