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. Object details

Object details

Scheduled Pinned Locked Moved C#
question
6 Posts 3 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.
  • D Offline
    D Offline
    DarrollWalsh
    wrote on last edited by
    #1

    I'm sure I know the answer but........ Is there a way to box an item without knowing or having access to the class defined in the type? I mean if I have an object can I see it's data items without boxing it to it's class? I would apreciate confirmation on my belief that this isn't possible or clarification on the issues with doing this. Thanks!

    Darroll

    L 1 Reply Last reply
    0
    • D DarrollWalsh

      I'm sure I know the answer but........ Is there a way to box an item without knowing or having access to the class defined in the type? I mean if I have an object can I see it's data items without boxing it to it's class? I would apreciate confirmation on my belief that this isn't possible or clarification on the issues with doing this. Thanks!

      Darroll

      L Offline
      L Offline
      led mike
      wrote on last edited by
      #2

      Darrol wrote:

      I mean if I have an object can I see it's data items without boxing it to it's class?

      "can I see"? What does that mean? You can see it in the Debugger yes? :confused:

      led mike

      D 1 Reply Last reply
      0
      • L led mike

        Darrol wrote:

        I mean if I have an object can I see it's data items without boxing it to it's class?

        "can I see"? What does that mean? You can see it in the Debugger yes? :confused:

        led mike

        D Offline
        D Offline
        DarrollWalsh
        wrote on last edited by
        #3

        I mean can I access and view or modify the data programmatically from within C#. Ultimately what I'd like is to create objects on the fly and be able to add data to them. I liken it to dynamic web pages where I can add controls to any container. I'd like to use the object, or use my own I guess, to create a fully flexible object.

        Darroll

        P 1 Reply Last reply
        0
        • D DarrollWalsh

          I mean can I access and view or modify the data programmatically from within C#. Ultimately what I'd like is to create objects on the fly and be able to add data to them. I liken it to dynamic web pages where I can add controls to any container. I'd like to use the object, or use my own I guess, to create a fully flexible object.

          Darroll

          P Offline
          P Offline
          Pete OHanlon
          wrote on last edited by
          #4

          I'm not 100% sure what you are trying to achieve. If you are asking, can you dynamically instantiate objects and manipulate them, then yes you can - you're looking to reflection to do this. If, on the other hand, you are asking if you can create new types objects at runtime and then manipulate them (i.e. dynamic typing), then you can do this as well - but you'll need to look at using the CodeDOM - or possibly Reflection.Emit.

          Deja View - the feeling that you've seen this post before.

          My blog | My articles

          D 1 Reply Last reply
          0
          • P Pete OHanlon

            I'm not 100% sure what you are trying to achieve. If you are asking, can you dynamically instantiate objects and manipulate them, then yes you can - you're looking to reflection to do this. If, on the other hand, you are asking if you can create new types objects at runtime and then manipulate them (i.e. dynamic typing), then you can do this as well - but you'll need to look at using the CodeDOM - or possibly Reflection.Emit.

            Deja View - the feeling that you've seen this post before.

            My blog | My articles

            D Offline
            D Offline
            DarrollWalsh
            wrote on last edited by
            #5

            Pete, it is the later of the two examples. Thank you for the direction. I will do some research on dynamic typing. Thanks!

            Darroll

            L 1 Reply Last reply
            0
            • D DarrollWalsh

              Pete, it is the later of the two examples. Thank you for the direction. I will do some research on dynamic typing. Thanks!

              Darroll

              L Offline
              L Offline
              led mike
              wrote on last edited by
              #6

              Darrol wrote:

              Pete, it is the later of the two examples.

              I hope you know what you're doing. Using CodeDom to generate code/compile and execute should probably be limited to a very small group of problem domains for which it is the last resort. In most situations the same problems can be solved with design and techniques like a plug-in mechanism.

              led mike

              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