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. PropertyDescriptor.GetValue and PropertyInfo.GetValue

PropertyDescriptor.GetValue and PropertyInfo.GetValue

Scheduled Pinned Locked Moved C#
tutorialquestion
3 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.
  • K Offline
    K Offline
    kashme
    wrote on last edited by
    #1

    PropertyDescriptor.GetValue(object component); what is this component. I do not get. Can someone please get an example. Also why PropertyInfo.GetValue(object, objects[]) needs to have parameters. Why we cannot have values through reflection directly. Can someone give me example of propertydescriptor.GetValue(object component), how to use it. I do not find much on msdn.

    L 2 Replies Last reply
    0
    • K kashme

      PropertyDescriptor.GetValue(object component); what is this component. I do not get. Can someone please get an example. Also why PropertyInfo.GetValue(object, objects[]) needs to have parameters. Why we cannot have values through reflection directly. Can someone give me example of propertydescriptor.GetValue(object component), how to use it. I do not find much on msdn.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      The component is the object instance to fetch from. To fetch the value you must have an acutal instance and the method must have a reference to it. I usually refer to it as the "context" but MS has called it the component here.

      Computers have been intelligent for a long time now. It just so happens that the program writers are about as effective as a room full of monkeys trying to crank out a copy of Hamlet.

      1 Reply Last reply
      0
      • K kashme

        PropertyDescriptor.GetValue(object component); what is this component. I do not get. Can someone please get an example. Also why PropertyInfo.GetValue(object, objects[]) needs to have parameters. Why we cannot have values through reflection directly. Can someone give me example of propertydescriptor.GetValue(object component), how to use it. I do not find much on msdn.

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        kashme wrote:

        what is this component

        It's an abstract description of a property[^].

        kashme wrote:

        Can someone please get an example

        At the bottom of that page are the usual examples. Used it for example, when implementing a GetProperties[^] method. A neat way to provide properties that a PropertyEditor can understand while passing an array wrapped in a ICustomTypeDescriptor[^].

        Bastard Programmer from Hell :suss:

        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