Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
I don't suppose this is possible in VB.NET' date=' is it?[/quote']

 

No, but I suspect that what you might want is just to nest classes to get the desired qualification:

 

e.g.,

class A

class B

enum C

...

 

So that the enum is referenced as A.B.C ... ??

Posted

>> An enum is just a list of consts, why would you need to nest them?

 

For easy categorizing.

 

 

 

Jaco -- Yeah, for something like that. I wondered if I'd have to do it that way with classes, so I'll just do that. Thanks.

Posted
>> An enum is just a list of consts, why would you need to nest them?

 

For easy categorizing.

What are you trying to model? Sets of enums? Sets are one thing missing from the .Net framework but there is an implementation from preilly's C# cookbook here. Look at chapter 10. recipe 10.8

Joe Mamma

Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized.

Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.

  • 7 years later...
Posted

Did you mean retrieving the full nested string name of an enum (e.g. System.Tools.Enums)?

 

Try This:

 

Dim x as System.Tools.SomeEnums = System.Tools.SomeEnums.FartKnocker

Dim y as String = GetType(x).ToString

 

Where:

 

Enum SomeEnums

FartKnocker = 1

JabberJaw = 2

None = 0

End Enum

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...