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!