[Feature Request]Reflection based atributes
See original GitHub issueTo bring this great project to a new level of freedom, we can add a bunch of reflection based attribute. The basic concept is use field/property/method name as attribute param, and use reflection to retrieve the value and decide how to draw.
For example:
public class DynamicShowIfAttribute : Attribute
{
public string showMethod;
public string enableMethod;
public DynamicShowIfAttribute (string showMethod, string enableMethod = null)
{
this.showMethod = showMethod;
}
}
public class Foo
{
[DynamicShowIf (nameof (showVal), nameof (EnableValFunc))]
public int val;
bool showVal = true;
bool ShowVal => true;
bool EnableValFunc ()
{
return true;
}
}
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
How to Manage and Write Feature Requests?
Types of Feature Requests They are a reflection of the user's needs, wants desires, and overall level of satisfaction with the product. The ......
Read more >Customizing Feature Request and Feedback Attributes - Savio
The feature request status attribute tells you where in the development process a feature is. You can customize it so that it fits...
Read more >Why You Need A Feature Request Tracking System
Most feature request tracking systems miss out on a key step in the process: understanding. They focus on delivering exactly what was requested,...
Read more >5 Best Practices to Manage Product Feature Requests
Feature requests are a great way to get the entire community involved in your product and give them a sense of ownership.
Read more >Reading Attributes with the Reflection API - Manual
This method returns an array of ReflectionAttribute instances that can be queried for attribute name, arguments and to instantiate an instance of the ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
A important use case is handle the class inheritance. For example, I usually put a help info box on top of my scripts. Without reflection based features, it is impossible to change that message in derived classes.
Hello,
from now, all condition drawers (EnableIf, HideIf, etc.) are able to use members of the parent class to pass values: