I'm having a bit of bother with System.ComponentModel.
My game engine targets both Windows and Xbox. The Windows build has a custom debugger in it, where the game pauses and a form opens with a PropertyGrid, which displays information about my game content.
In order to make the PropertyGrid readable, I've added various field attributes my properties, e.g.:
| [CategoryAttribute(pgID), DescriptionAttribute("Internal ID"), ReadOnlyAttribute(true)] |
| public string id { get; set; } |
However the Xbox360 version of System.ComponentModel doesn't contain definitions for these attributes, so it won't compile. I can get around this using pre-processor symbols, e.g.:
| #if WINDOWS |
| [CategoryAttribute(pgID), DescriptionAttribute("Internal ID"), ReadOnlyAttribute(true)] |
| #endif |
| public string id { get; set; } |
However, the code soon gets very ugly when dozens of properties are dealt with in the above way. I've searched the forums and I'm surprised that nobody else seems to have encountered this problem, especially given how many people have made level editors etc. Does anyone know of a more elegant way around this that I've overlooked?
Thanks.
XAGE - Xna Adventure Game Engine