Is there a way to say that an attribute only works when used with static methods?
AttributeUsage class does not seem to allow such speciffic use.
AttributeUsage
[AttributeUsage(AttributeTargets.Method, Inherited = false, AllowMultiple = false)]
No, there is no way to limit this. However - you can use reflection at run time to ensure that this is done.
In C # there is no such function that allows you to limit the use of attributes based on the availability of an element.
Source: https://habr.com/ru/post/1481910/More articles:Problems with the group in order and order - sqlDatabase Layer Design - oopCreate a table view in this format Category / subcategoy / subcategory - iphonegdbserver support arm trace point - armIf the condition is inside the target in the Makefile - makefilehttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1481911/find-the-nearest-postcodes-to-given-postcode-using-ordance-survey-easting-and-northing-system&usg=ALkJrhjbj4IYNi0vU2EZnCCoJDU3S2sU5AHow to override a field in a base class with a property in a derived class? - pythonAn Aspx page runs in the background even after closing a browser window - c #MySQL Complex Queries for Distributing Data across Multiple Tables (PHP) - sqlWPF Management Templates - How to create a custom property? - c #All Articles