System.Type Object
-
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
-
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
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.
-
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.
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 typeType permType = Type.GetType(typeName);
and then you can instanciate your type like so:object permission = Activator.CreateInstance(permType);