CSharp examples for Microsoft.CodeAnalysis:Roslyn
Is type of integer using Roslyn?
using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis; public class Main{ /// <summary> /// Is type of integer? /// </summary> /// <param name="symbol"></param> /// <returns></returns> public static bool IsInt(this ITypeSymbol symbol) {//from www .ja v a 2s. c o m if (symbol == null) return false; return symbol.MetadataName == "Int32" || symbol.MetadataName == "Int64"; } }