Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Attributes and there constructors...

Attributes and there constructors...

Scheduled Pinned Locked Moved C#
question
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Paw Jershauge
    wrote on last edited by
    #1

    I have a quick question about Attributes When we use the Description attribute we normaly do it like this

    [Description("Class that contains information about an user")]
    public class user
    {

    }

    But how come we can construct the type like Description("") and DescriptionAttribute("") ??? i mean, i can't seem to find the class called Description, when i look with the object browser, but the DescriptionAttribute is there.:confused::confused: I have been looking on MSDN, but nothing seems to popup about this. Anyone have a answer :doh: :doh:

    S 1 Reply Last reply
    0
    • P Paw Jershauge

      I have a quick question about Attributes When we use the Description attribute we normaly do it like this

      [Description("Class that contains information about an user")]
      public class user
      {

      }

      But how come we can construct the type like Description("") and DescriptionAttribute("") ??? i mean, i can't seem to find the class called Description, when i look with the object browser, but the DescriptionAttribute is there.:confused::confused: I have been looking on MSDN, but nothing seems to popup about this. Anyone have a answer :doh: :doh:

      S Offline
      S Offline
      Spacix One
      wrote on last edited by
      #2

      stuff surrounded by "[" and "]" are not normal classes. They are class attributes and can be used hundreds of different ways... Look here for more info: http://www.codeproject.com/KB/cs/attributes.aspx[^]


      -Spacix All your skynet questions[^] belong to solved


      I dislike the black-and-white voting system on questions/answers. X|


      P 1 Reply Last reply
      0
      • S Spacix One

        stuff surrounded by "[" and "]" are not normal classes. They are class attributes and can be used hundreds of different ways... Look here for more info: http://www.codeproject.com/KB/cs/attributes.aspx[^]


        -Spacix All your skynet questions[^] belong to solved


        I dislike the black-and-white voting system on questions/answers. X|


        P Offline
        P Offline
        Paw Jershauge
        wrote on last edited by
        #3

        aha, i see, it seems that the Compiler looks this information up... Quote from (Spacix One) link: The compiler first searches the attribute in System.Attribute derived classes... Hmmm that information i could not find on the MSDN... or im not looking the right places... :) Thanks Spacix One

        S 1 Reply Last reply
        0
        • P Paw Jershauge

          aha, i see, it seems that the Compiler looks this information up... Quote from (Spacix One) link: The compiler first searches the attribute in System.Attribute derived classes... Hmmm that information i could not find on the MSDN... or im not looking the right places... :) Thanks Spacix One

          S Offline
          S Offline
          Spacix One
          wrote on last edited by
          #4

          no problem, it is hard to look up something if you don't know its proper name or origin base class :) MSDN has information here: http://msdn.microsoft.com/en-us/library/system.attribute.aspx[^] Look for "abbreviated name"


          -Spacix All your skynet questions[^] belong to solved


          I dislike the black-and-white voting system on questions/answers. X|


          P 1 Reply Last reply
          0
          • S Spacix One

            no problem, it is hard to look up something if you don't know its proper name or origin base class :) MSDN has information here: http://msdn.microsoft.com/en-us/library/system.attribute.aspx[^] Look for "abbreviated name"


            -Spacix All your skynet questions[^] belong to solved


            I dislike the black-and-white voting system on questions/answers. X|


            P Offline
            P Offline
            Paw Jershauge
            wrote on last edited by
            #5

            yeah i know it can be hard, and i was by that site, but, nothing seemed to popup in my face about this... :-O but now i know, and thats whats counts. ;P

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups