Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 892637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T14:05:22+00:00 2026-05-15T14:05:22+00:00

I have about 30 different flagged enums that I would like to put into

  • 0

I have about 30 different flagged enums that I would like to put into an array for indexing and quick access. Let me also claify that I do not have 1 enum with 30 values but I have 30 enums with differing amounts of values.

The goal would be to add them to an array at a specifed index. This way I can write a functions in which I can pass the array index into for setting particuler values of the enum.

Updated:
Here is an example of what I am wanting to do.

enum main(
enum1 = 0,
enum2 = 1,
enumn = n-1 ) – this has indexs which would match the index of the associated enum

[flag]
enum1(value1=0, value2=1, value3=2, value4=4…)

[flag]
enum2(“”)

[flag]
enum2(“”)

since I am using flagable enums I have a class like the following

public static class CEnumWorker
{
   public static enum1 myEnum1 = enum1.value1;
   public static enum2 myEnum2 = enum2.value1;
   public static enumN myEnumN = enumN.value1;

   //I would then have functions that set the flags on the enums. I would like to access the enums through an array or other method so that I do not have to build a large switch statement to know which enum I am wanting to manipulate
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T14:05:22+00:00Added an answer on May 15, 2026 at 2:05 pm

    Since you have 30 different types of enums, you can’t create a strongly typed array for them. The best you could do would be an array of System.Enum:

    Enum[] enums = new Enum[] { enum1.Value1, enum2.Value2, etc };
    

    You would then have to cast when pulling an enum out of the array if you need the strongly typed enum value.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Do I have to put every file in a different folder? like: about-us/about-us.php profile/profile.php
We have about 10 different daemons for which we would like to use syslog
I'm learning about packages. I have two classes that are in different packages and
I have about 10 different objects that get populated from user input. Instead of
I have about 10 different entities in my J2EE application that right now share
I'm building a Qt application that have about 30 different views (QWidgets). My idea
Here is my situation: I have about 50 different fields of data that I
I have read about multiple different git branching strategies and I was suprized that
I have about 20 different images that I want to fade in and out
I have about 10 different sql statements that update different tables. They look similar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.