Attributes (intrinsic/pre-defined/standard)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jim Trela

    Attributes (intrinsic/pre-defined/standard)

    How can I find out the names of all the attributes that
    are intrinsic (pre-defined, or standard) in the .NET
    framework ? I saw in a presentation that there are
    supposedly around 178 pre-defined ones. I know that it is
    possible to define your own, but I want to know what the
    standard ones are, besides [Webmethod] and [Serializable].
    I did try searching the the help alphabetically ([a*],
    [b*], ...), but my query was not limited to the results I
    expected.

    Also, since the interface "ISerializa ble" is also
    implemented as an attribute ([Serializable] ?), is EVERY
    interface implemented as an attribute ? Conversely, does
    every attribute have a counterpart that is an interface ?
    For instance, I don't believe that "[Webmethod]" has a
    corresponding interface named something like "IWebmethod ".

  • Mattias Sjögren

    #2
    Re: Attributes (intrinsic/pre-defined/standard)

    Jim,
    [color=blue]
    >How can I find out the names of all the attributes that
    >are intrinsic (pre-defined, or standard) in the .NET
    >framework ?[/color]

    See

    Learn with interactive lessons and technical documentation, earn professional development hours and certifications, and connect with the community.


    Or open up Wincv.exe and type in "Attribute" .


    [color=blue]
    > Also, since the interface "ISerializa ble" is also
    >implemented as an attribute ([Serializable] ?), is EVERY
    >interface implemented as an attribute ?[/color]

    No

    [color=blue]
    >Conversely, does
    >every attribute have a counterpart that is an interface ?[/color]

    No



    Mattias

    --
    Mattias Sjögren [MVP] mattias @ mvps.org

    Please reply only to the newsgroup.

    Comment

    • Eric Gunnerson [MS]

      #3
      Re: Attributes (intrinsic/pre-defined/standard)

      I don't know of any list that shows all the attributes. You could write
      something that would iterate over all the classes in all the assemblies and
      list those that derive from System.Assembly .

      [Serializable] is the attribute used to indicate that a class can be
      serialized. ISerializable is used to provide customer serialization for a
      class. They're related, but not the same thing.

      --
      Eric Gunnerson

      Visit the C# product team at http://www.csharp.net
      Eric's blog is at http://blogs.gotdotnet.com/ericgu/

      This posting is provided "AS IS" with no warranties, and confers no rights.
      "Jim Trela" <jmtrela@yahoo. com> wrote in message
      news:0b7701c386 31$ab66daf0$a10 1280a@phx.gbl.. .[color=blue]
      > How can I find out the names of all the attributes that
      > are intrinsic (pre-defined, or standard) in the .NET
      > framework ? I saw in a presentation that there are
      > supposedly around 178 pre-defined ones. I know that it is
      > possible to define your own, but I want to know what the
      > standard ones are, besides [Webmethod] and [Serializable].
      > I did try searching the the help alphabetically ([a*],
      > [b*], ...), but my query was not limited to the results I
      > expected.
      >
      > Also, since the interface "ISerializa ble" is also
      > implemented as an attribute ([Serializable] ?), is EVERY
      > interface implemented as an attribute ? Conversely, does
      > every attribute have a counterpart that is an interface ?
      > For instance, I don't believe that "[Webmethod]" has a
      > corresponding interface named something like "IWebmethod ".
      >[/color]


      Comment

      Working...