I'm wondering if you could add "MarkedUpClass" (like MarkedUpField but for classes)? This is so that the same class be reused in multiple places without having to specify the MarkedUpField-attribute every time - as this would cause issues for co-developers not knowing that MarkedUpField has to be added (and exactly which parameters are needed). Something like this:
[MarkedUpClass]
public class TestClass
{
public string message = "hello world";
}
I've implemented it and it works, but I think you could implement it a bit prettier than my first attempt. :P
You could also implement it quite easily if you just changed MarkedUpFieldAttribute to allow targeting classes/structs and after that change one line of code:
var markedUp = fieldInfo.GetCustomAttribute<MarkedUpFieldAttribute>();
would become:
var markedUp = fieldInfo.FieldType.GetCustomAttribute<MarkedUpFieldAttribute>(true); //here we look class-level attributes
if(markedUp == null) //if that is null, we instead look at field-level attributes
markedUp = fieldInfo.GetCustomAttribute<MarkedUpFieldAttribute>();
Hi! I think it's a good idea. Honestly, not sure why I didn't do it this way in the first place. I'll implement this next time I have bit of free time.
Hey, first of all, amazing lib @gasgiant !
I'm wondering if you could add "MarkedUpClass" (like MarkedUpField but for classes)? This is so that the same class be reused in multiple places without having to specify the MarkedUpField-attribute every time - as this would cause issues for co-developers not knowing that MarkedUpField has to be added (and exactly which parameters are needed). Something like this:
I've implemented it and it works, but I think you could implement it a bit prettier than my first attempt. :P
You could also implement it quite easily if you just changed MarkedUpFieldAttribute to allow targeting classes/structs and after that change one line of code:
var markedUp = fieldInfo.GetCustomAttribute<MarkedUpFieldAttribute>();
would become: