GlobalMultiuse?

  • Thread starter Thread starter Alan Roberts
  • Start date Start date
A

Alan Roberts

How can I make an item accessible to all areas of my assembly? For instance
say I have a string constant called sProgramName that I set to be "My
Program" located in a class called CConstants. How can I make this string
accessible to all classes within my assembly without 1) having to
instantiate a class or 2) reference the class (eg I want to just reference
sProgramName not CConstants.sProgramName)?

Thanks

Alan
 
Alan,
How can I make this string
accessible to all classes within my assembly without 1) having to
instantiate a class

Constants are implicitly static so you never need to instantiate the class
to access it. Just make sure the constant is public or internal so other
classes can reference it.

2) reference the class (eg I want to just reference sProgramName not CConstants.sProgramName)?

That you can't do.


Mattias
 
Back
Top