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. .NET (Core and Framework)
  4. System.Type Object

System.Type Object

Scheduled Pinned Locked Moved .NET (Core and Framework)
xmlquestion
3 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
    Dan Broomall
    wrote on last edited by
    #1

    I am attempting to load some controls at runtime based on information from an XML file. However, I can't get the System.Type object created properly. Documentation alludes to the idea that the System.Type object can only represent simple/base data types. Does anyone out there know if this is correct or not? Thanks Dan Broomall

    A 1 Reply Last reply
    0
    • D Dan Broomall

      I am attempting to load some controls at runtime based on information from an XML file. However, I can't get the System.Type object created properly. Documentation alludes to the idea that the System.Type object can only represent simple/base data types. Does anyone out there know if this is correct or not? Thanks Dan Broomall

      A Offline
      A Offline
      Andy Brummer
      wrote on last edited by
      #2

      How are you getting the Type object. Some code might be helpful. There is a type for every class that you create. If you are using Assembly.GetType(string) for exampe, make sure you use the fully qualified name for the type including namespaces. My goal is to look at code like a chessmaster looks at a chessboard to see positions and possibilites beyond lines and characters.

      R 1 Reply Last reply
      0
      • A Andy Brummer

        How are you getting the Type object. Some code might be helpful. There is a type for every class that you create. If you are using Assembly.GetType(string) for exampe, make sure you use the fully qualified name for the type including namespaces. My goal is to look at code like a chessmaster looks at a chessboard to see positions and possibilites beyond lines and characters.

        R Offline
        R Offline
        Roman Rodov
        wrote on last edited by
        #3

        if you have for example a type name string in a file for example string typeName = "System.Security.Permissions.FileIOPermission"; you can do the following to get the type Type permType = Type.GetType(typeName); and then you can instanciate your type like so: object permission = Activator.CreateInstance(permType);

        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