static in attributes

  • Thread starter Thread starter Pohihihi
  • Start date Start date
Pohihihi,

Attributes can have static methods/properties, just like any other
class. However, you have to remember that a static method/property on an
attribute will not be applicable to the type, but rather, all types.

Hope this helps.
 
Actually I am not understanding what you mean by
attribute will not be applicable to the type, but rather, all types

you mean it will behave like
[AttributeUsage(AttributeTargets.All)]

??

Thanks,
Po

Nicholas Paldino said:
Pohihihi,

Attributes can have static methods/properties, just like any other
class. However, you have to remember that a static method/property on an
attribute will not be applicable to the type, but rather, all types.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Pohihihi said:
In what condition attributes (class) might have static methods?
 
Back
Top