How to make the app see class instance ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • BbEsy
    New Member
    • Sep 2009
    • 28

    How to make the app see class instance ?

    Hello all,
    im new to c#, Io have one question. I think its easy and simple, but I can't found any help.

    i have clas named Entity..

    i can make new instance of it by:
    Entity eraser = new Entity("Eraser ", 6, 2, 3);

    but when i create this i cant manage it anywhere, only where i created it.

    How i can make this instance of class visible everywhere?

    Regards

    esy
  • tlhintoq
    Recognized Expert Specialist
    • Mar 2008
    • 3532

    #2
    You need to read up on the "scope" of an object. Scope is basically an object's lifespan. Take a look at this thread. It is about accessing properties of one class from another and talks a bit about the scope of the class being broad enough so it can be seen by other classes. Sounds like what you are trying to do.

    Comment

    Working...