EDIT: I want to convert Type variable to its c# representation.
I recently wanted to use the Type.FullName property to create c# scripts automatically but when I tried to use Type.FullName it returns plus (+) sign instead dot (.).
Here is an example.
class Outer
{
class Inner
{
}
}
Now if you want to access Inner
class you should do Outer.Inner
for accessing the Inner
class.
Type.FullName outputs:
Outer+Inner
While it uses a dot for namespaces.
I know I can fix it by doing a simple Replace call, but it is not the only problem because of the Type.FullName products more unexcepted character and I want to fix them all.
So now, how can I convert the syntax of Type.FullName to C# Syntax?
Here is an example of an illegal syntax of Type.FullName:
System.Collections.Generic.List`1[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]
While it should be:
System.Collections.Generic.List<System.String>
See more examples in MSDN documentation.