Collection of Enum with additional properties

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Donal McWeeney (donal_mcweeney_at_NO-SP-AM.aimware.com)
Date: 04/29/04


Date: Thu, 29 Apr 2004 15:16:05 +0100

Just thinking out loud here and looking for feedback in case I missed
something...

I was to track some additional properties around an enum I have - for
example a display name and a description. So I was thinking a building a
class EnumDescriptor to store these properties - and make it generic so that
it could be used for all enums.

I also need to be able to store and manage a collection of these
EnumDescriptor objects... for this I was thinking of building a custom
collection class (EnumDescriptorCollection) by inheriting from the the
NameObjectCollectionBase class.

Anybody know if I missed something in the .net framework that may do the
above for me?
Or if I missed anything in the logic...

Thanks

    Donal



Relevant Pages

  • Re: BIT banging help
    ...  how many enum values can I store with a long? ... store as a bigint in sqlserver). ... I want to be able to AND and OR each permission enum value, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: how to parse an Enum Structure in vb.net
    ... Storing the names is something that should be considered in some cases, ... In other cases the names have no natural numbering at all, then it might be better to store the names. ... You can just as easily assign numbers to each enum value, i.e., ... Filibuster = 25 ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Enum
    ... So trying to store both ... Required and Validate in a variable declared as Mode is like trying to ... You are going to need a third item in the Enum. ... RequiredValidate? ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: My component does not serialize CollectionBase derived property?
    ... DesignerSerializationVisibility attribute? ... Content enum. ... > I created a new collection class derived from CollectionBase and my ... > Anybody has a clue? ...
    (microsoft.public.dotnet.framework.windowsforms.designtime)
  • Re: Not quite an enum, not quite a dictionary
    ... It seems to adds a lot of complexity to the ... collection class. ... You could create a helper class that formats the enum name... ... Tom Shelton ...
    (microsoft.public.dotnet.languages.vb)