Hi Sharon,
I'm not exactly sure how to do it using CodeDom, although I suspect that it's
possible, but here's a custom solution that should work just fine (2.0
framework):
System.Collections.Generic.Dictionary<string, stringcSharpTokens =
new System.Collections.Generic.Dictionary<string, string>();
cSharpTokens.Add("bool", "System.Boolean");
cSharpTokens.Add("byte", "System.Byte");
cSharpTokens.Add("sbyte", "System.SByte");
cSharpTokens.Add("char", "System.Char");
cSharpTokens.Add("decimal", "System.Decimal");
cSharpTokens.Add("double", "System.Double");
cSharpTokens.Add("float", "System.Single");
cSharpTokens.Add("int", "System.Int32");
cSharpTokens.Add("uint", "System.UInt32");
cSharpTokens.Add("long", "System.Int64");
cSharpTokens.Add("ulong", "System.UInt64");
cSharpTokens.Add("object", "System.Object");
cSharpTokens.Add("short", "System.Int16");
cSharpTokens.Add("ushort", "System.UInt16");
cSharpTokens.Add("string", "System.String");
Type type = Type.GetType(cSharpTokens["int"]);
Console.WriteLine(type.FullName);
Output:
System.Int32
--
Dave Sexton
"Sharon" <Sh*****@newsgroups.nospamwrote in message
news:E6**********************************@microsof t.com...
There is an built-in types table for .NET framework type to C# type which
are
aliases of predefined types in the System namespace
(http://msdn2.microsoft.com/en-US/library/ya5y69ds.aspx).
How can use access and use this table (by C# code) to convert the alias to
the .NET framework type.
For example: if I have:
string aliasType = "int";
string frameworkType = ???
-------
Thanks
Sharon