Basic question about enums

  • Thread starter Hans De Schrijver
  • 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
 
P

Peter Rilling

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

Help with statement Select Case in BASIC 7
Question about my projects 3
Basic question about compiling 26
enums and modifiers 5
Question about Typesafe Enums 8
enums 6
Question about import hooks 0
enums and scope 5

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top