c# - referencing other class methods without creating a new instance -


i have class called clientchat basic network stuff. have several other classes linked different window forms. in first form have variable referenced chat class so:

clientchat cc = new clientchat(); 

everything works okay their, class has been initialized , in motion. after first forms done performing it's duty bring second form that's linked new class file.

now question is, how can reference what's going on in clientchat class without setting new instance of class? need pass data form networkstream , if create new instance of class wouldn't require new connection server , require start on since it's "new"? i'm bit confused , great, thanks. c# on .net4.0

you create instance of clientchat in beginning of program , then, pass reference classes need it.


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -