CSharp.

GetNameCS(Type, CSharp.NameVerbosity) Method

Summary

Returns the name of a `type` as it would appear in C# code. Results are cached.
Assembly
Weaver.dll
Namespace
Weaver
Containing Type
CSharp

Syntax

public static string GetNameCS(this Type type, CSharp.NameVerbosity verbosity = Full)

Examples

typeof(List<float>).FullName would give: System.Collections.Generic.List`1[[System.Single, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] This method would instead return a different result depending on the specified `verbosity`:
  • would return "List<float>".
  • is like but also includes nested types.
  • would return "System.Collections.Generic.List<float>".
  • would return "global::System.Collections.Generic.List<float>".

Parameters

Name Type Description
type Type
verbosity CSharp.NameVerbosity

Return Value

Type Description
string