Is type of Bool? - CSharp System.Reflection

CSharp examples for System.Reflection:Type

Description

Is type of Bool?

Demo Code


using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis;

public class Main{
        /// <summary>
        /// Is type of Bool?
        /// </summary>
        /// <param name="symbol"></param>
        /// <returns></returns>
        public static bool IsBool(this ITypeSymbol symbol)
        {/*from  w  w w  .  j  a  v a 2s. c  o  m*/
            if (symbol == null) return false;
            return symbol.MetadataName == "Boolean";
        }
}

Related Tutorials