Pohihihi,
No, what I meant was that instance properties and methods on an
attribute have the scope of the thing they are applied to (let's assume we
are talking about a class here for a moment).
With static members, those are applicable to everything. Remember, an
attribute is applied to a type, or part of a type, and becomes part of the
metadata for that type. If you are going to add static members to an
attribute, make sure it is designed properly.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"Pohihihi" <po******@hotmail.com> wrote in message
news:ey**************@tk2msftngp13.phx.gbl...
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 [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote
in
message news:%2****************@tk2msftngp13.phx.gbl... 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]
- ca*******@caspershouse.com
"Pohihihi" <po******@hotmail.com> wrote in message
news:u4****************@TK2MSFTNGP12.phx.gbl... In what condition attributes (class) might have static methods?