IMHO Very Useful t4 template - Need help for integration

Hi there,

I think I created a very useful t4 template. Some of you will know the automatic class generation for Resources to safe access in code. I think this would be handy for content-resources in monogame too. This is why I wrote a simple script, which parses the visual studio project structure an generates a static class to access resources with compiled names. Here a small example:

You have the folders Textures and SpriteFonts in the Content folder. In these folders are player.xnb, ball.xnb (in the Textures folder) and normalfont.xnb (in the SpriteFonts folder). Using the t4-template the following resource-File will be created automatically:

namespace Game2DFramework.MonoGame
{
public static class ResourceNames
{
    
    public static class Spritefonts
    {
        public const string NormalFont = "Spritefonts/NormalFont.spritefont";
    }
    
    public static class Textures
    {
        public const string Player = "Textures/Player";
        public const string Ball = "Textures/Ball";
    }
}
}

The root namespace is the namespace of the project. So access to the resources would be like this:

var texturePlayer = Game.Content.Load<Texture2D>(ResourceNames.Textures.Player);

So the usage is very simple. if you move resources around, the code won’t compile (if you run the templates of course) and this will save a lot of work.

I thougt about to provide this feature in the project templates but the current templates are for me unaccessable because I have windows 7. Is the community interested in this template?