Actually I'm not sure if this has to do specifically with generic
types, but I don't understand the output from the following
programlet, which is:
System.Collections.Generic.List`1[TestApp.Program+A]
What are the extraneous characters doing there?
SNIPPED CODE
When you GetType() off a generic, you are seeing both the type (the
generic list) and some information about what is actually held in the
list. That is the "extraneous" bits you see.
I can rewrite the majority of your code by looking at this (without
looking at what I snipped out):
System.Collections.Generic.List`1[TestApp.Program+A]
First, the actual type is an internal class A inside a class called
Program, which is inside the namespace TestApp.
//From [TestApp.Program+A]
namespace TestApp
{
public class Program
{
internal class A
{
}
}
}
With A being inside Program, I can tell the running routine is inside
program, so it would look something like this:
//From [TestApp.Program+A]
namespace TestApp
{
public class Program
{
internal class A
{
}
//Since you are outputting GetType()
//I know you have a Main() routine
static void Main(string[] args)
{
//From System.Collections.Generic.List
//and Program+A, focusing on the +
List<A> list = new List<A>();
//The line that outputs what you have
Console.WriteLine(list.GetType().ToString());
//Stop so you can read from Console
Console.Read();
}
}
}
make sense? I hope this points out that the extraneous stuff. I am not
sure what the 1 means here.
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
Twitter: @gbworld
Blog:
http://gregorybeamer.spaces.live.com
*******************************************
| Think outside the box! |
*******************************************