c# - Getting the fully qualified name of a type from a TypeInfo object -


After

In any way to get a fully qualified name of the type contained in a TypeInfo object possible?

Many of these values ​​in the debugger are shown as well as System.Int32 , but when it is printed, in one of them it is completely Not a valid name. I need to provide a code for Type.GetType () .

  var type INFO = moneycontrol Model Gate type info (logic); Var w = typeInfo.ToString (); // Microsoft.CodeAnalysis.TypeInfo var y = typeInfo.Type.ToString (); // int var z = typeInfo.Type.ToDisplayString (); // int var a = typeInfo.Type.OriginalDefinition.ToDisplayString (); // int var b = typeInfo.Type.OriginalDefinition.ToString (); // int var c = typeInfo.Type.Name; // Int32 var d = typeInfo.Type.MetadataName; // Int32 var e = typeInfo.Type.ToDisplayParts (); // {int} var f = typeInfo.Type.ContainingNamespace; // system   

Note that this should work for every type, so I can not just add a namespace with the name

Optional:. Is there another (more favorable) way to get the exact type?

For reference: I want to see that there are certain methods in the type-parameter of the class. Therefore my approach was to be the parameter from TypeArgumentListSyntax and to get the TypeInfo from each TypeSyntax object.

itemprop = "text">

ToDisplayString method is a "format" object that has a nearby feature Gives a great number of options to control how you want to format the stuff:

  symbolDisplayFormat = new symbolDisplayFormat (typeQualificationStyle: SymbolDisplayTypeQualificationStyle.NameAndContainingTypesAndNamespaces); String Fully Qualified Name = Typing Simbol Two display string (symbol display format);   

Due to the reason "integer" your getting keyword is default format SymbolDisplayMiscellaneousOptions.UseSpecialTypes is the flag specified for using the language for special type vs. Does the keywords have regular names?

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -