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

  • Home
  • SEARCH
  • 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 351657
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T11:39:51+00:00 2026-05-12T11:39:51+00:00

First, I am not talking about the new ‘dynamic’ keyword n C# 4.0. :)

  • 0

First, I am not talking about the new ‘dynamic’ keyword n C# 4.0. 🙂 I believe I need to go the other way…

I want a class, at code/design-time, that is generated from a set of XML files, or files/folder combinations, etc. Anything I can do with a change to the extern source.

Is this possible with C#? I know it is possible with some design-time compliation of some hidden class name or something (i.e. the built in Properties for each project).

Is there an easier way to do this? ALmost like a dynamic enum? Here’s what I am trying to do:

public static class MenuItems
{
}

And at design-time, I want the properties (or methods/fields, if that’s easier) added based on an XML file definition. Like:

<MenuItems>
  <Item>Homepage</Item>
  <Item>Portfolio</Item>
  <Item>About</Item>
  <Item>Contact</Item>
</MenuItem>

Then, while coding in the designer I would have intellisense like:

if (page.ToString == MenuItems.Homepage)...
if (page.ToString == MenuItems.Portfolio)...

Notice how the properties were defined in the XML, and added to the class at design time?

Thanks in advance!

  • 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-12T11:39:51+00:00Added an answer on May 12, 2026 at 11:39 am

    You can use T4 Templates to generate source code. It is well supported by Microsoft and is used on several projects including ASP.NET MVC, and soon the ADO.NET Entity Framework.

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

Sidebar

Related Questions

I'm not sure how tests first works and I'd like to hear arguments about
I have a stored procedure that returns two int Values. The first can not
A few quick searches discovered that I'm obviously not the first person to have
First of all: I am not an experienced ClearCase user, but I have lots
First of all,I'm not into web programming. I bumped into django and read a
First of all, I'm not looking for miracle... I know how PHP works and
I'm not asking this question because of the merits of garbage collection first of
First off, let me start off that I am not a .net developer. The
This question might not seem programming related at first, but let me explain. I'm
First of all there is a partial question regarding this, but it is not

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.