Beispiel #1
0
 public static string GetPartialTypeName(this TypeSyntax type)
 {
     return(type.As <IdentifierNameSyntax>()?.Identifier.Text
            ?? type.As <GenericNameSyntax>()?.Identifier.Text
            ?? type.As <PointerTypeSyntax>()?.ElementType?.GetPartialTypeName()
            ?? type.As <ArrayTypeSyntax>()?.ElementType?.GetPartialTypeName()
            ?? type.As <NullableTypeSyntax>()?.ElementType?.GetPartialTypeName()
            ?? type.As <PredefinedTypeSyntax>()?.GetText()?.ToString()?.Trim());
 }