all groups > vb.net > january 2008 >
You're in the

vb.net

group:

Global Enum question


Global Enum question BobRoyAce
1/7/2008 9:28:38 AM
vb.net:
I have a module that defines, among other things, an Enum:

--- MODULE CODE BEGINS ---
Namespace OMEGA.GRP
Module Globals
...
Public Enum FileProcessingStatus
None
Processing = 1
Completed = 2
Failed = 3
End Enum
...
End Module
End Namespace
--- MODULE CODE ENDS ---

Then, in a class module file, I have:

--- CLASS CODE BEGINS ---
Public Class clsFileProcessor
...
Private _ProcessingStatus As FileProcessingStatus
...
Public ReadOnly Property ProcessingStatus() As FileProcessingStatus
Get
Return _ProcessingStatus
End Get
End Property
...
End Class
--- CLASS CODE ENDS ---

This will not compile...get error message:
'ProcessingResult' cannot expose type
'OMEGA.GRP.Globals.FileProcessingStatus' outside the project through
class 'clsInputfeedFileProcessor'. C:\...\Classes
\clsInputfeedFileProcessor.vb

I have only a single project within the solution. I addition, when I
remove the Namespace declaration in the first quoted module, the error
message still occurs.

What am I doing wrong here and how do I fix it? The bottom line is
that I would like to define some global Enums that can be used
Re: Global Enum question Herfried K. Wagner [MVP]
1/7/2008 6:52:10 PM
"BobRoyAce" <broy@omegasoftwareinc.com> schrieb:
[quoted text, click to view]

Note that this will implicitly mark the module as 'Friend', which is less
visible than 'Public'.

[quoted text, click to view]

I suggest to remove the module completely. Enumerations are types, so you
do not need to nest them inside modules.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
AddThis Social Bookmark Button