By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,168 Members | 2,548 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,168 IT Pros & Developers. It's quick & easy.

How to publicly expose an enum from a class library

P: n/a
Don
It is possible to expose an enumerated type from within a class library so
that other projects referencing that class library will see it in the
class's namespace? For example, if I have a class library called "foo"
which has a public enumerated type called "bar" declared in a module of that
class library, is it possible for a different project referencing "foo" to
be able to declare variables of type "foo.bar"?

- Don
Nov 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
"Don" <un*****@oblivion.com> schrieb
It is possible to expose an enumerated type from within a class
library so that other projects referencing that class library will
see it in the class's namespace? For example, if I have a class
library called "foo" which has a public enumerated type called "bar"
declared in a module of that class library, is it possible for a
different project referencing "foo" to be able to declare variables
of type "foo.bar"?


You don't have to put it in a module (but of course you can). If you declare
the Enum Public, there should be no problem. If you put it in a module or a
class, the module/class must also be public.
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #2

P: n/a
Don
Okay, that's what the problem was. I had put it in a module, but had not
delcared the module as public. Thanks.

- Don
"Armin Zingler" <az*******@freenet.de> wrote in message
news:ev**************@TK2MSFTNGP12.phx.gbl...
"Don" <un*****@oblivion.com> schrieb
It is possible to expose an enumerated type from within a class
library so that other projects referencing that class library will
see it in the class's namespace? For example, if I have a class
library called "foo" which has a public enumerated type called "bar"
declared in a module of that class library, is it possible for a
different project referencing "foo" to be able to declare variables
of type "foo.bar"?
You don't have to put it in a module (but of course you can). If you

declare the Enum Public, there should be no problem. If you put it in a module or a class, the module/class must also be public.
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #3

P: n/a
* "Don" <un*****@oblivion.com> scripsit:
It is possible to expose an enumerated type from within a class library so
that other projects referencing that class library will see it in the
class's namespace? For example, if I have a class library called "foo"
which has a public enumerated type called "bar" declared in a module of that
class library, is it possible for a different project referencing "foo" to
be able to declare variables of type "foo.bar"?


Just declare the enum directly in the namespace (not within a module or
class).

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #4

P: n/a
Don
I didn't know you could do that. That is preferable to either method and
feels more "correct".

- Don

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:bu************@ID-208219.news.uni-berlin.de...
* "Don" <un*****@oblivion.com> scripsit:
It is possible to expose an enumerated type from within a class library so that other projects referencing that class library will see it in the
class's namespace? For example, if I have a class library called "foo"
which has a public enumerated type called "bar" declared in a module of that class library, is it possible for a different project referencing "foo" to be able to declare variables of type "foo.bar"?


Just declare the enum directly in the namespace (not within a module or
class).

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.