Basic question about enums

  • Thread starter Thread starter Hans De Schrijver
  • Start date Start date
H

Hans De Schrijver

Another basic question.

In VB6, when I needed an enum that was used by multiple classes and/or
modules, I would put it in a module and set it as public enum, so the entire
project would have access to the enum and I would only have to maintain it
in one place.

In a C#.NET assembly, where would I put an enum that needs to be accessible
by multiple classes and what access modifiers would I need?

-- Hans De Schrijver
 
Same way you would make a class publicly available to other classes. Make
the enum public and do not nest it inside any other class.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Enum TypeConverter 3
about enum 3
Compilation error CS0103 6
Merge Info From Two Enums 1
Enums 3
Global access of Enum 2
Enums and returning primitive types 3
enums 2

Back
Top